I am currently using Angular 5.x in combination with the select
tag and optgroup
, along with Bootstrap 4.1.x
This is how my component.html
looks like:
<select size="15" class="form-control mr-4">
<optgroup label="Properties">
<option *ngFor="let eachVal of dataResults"
[selected]="searchModel.translatedProperty===eachVal.translatedProperty"
(click)="getPropertyValues(eachVal)">
<span>{{eachVal.translatedProperty}}</span>
</option>
</optgroup>
<optgroup label="References">
<option *ngFor="e;let eachVal of objResults; let i=index;"
[selected]="searchModel.translatedProperty===eachVal.translatedProperty"
(click)="getReferenceValues(eachVal, i)">
<span>{{eachVal.translatedProperty}}</span>
</option>
</optgroup>
The form-control
class is applied to the select
element as per the Bootstrap Forms Documentation source
Here's how the list is rendered:
Mozilla Firefox
In Mozilla Firefox v.60.0.2
https://i.sstatic.net/zwr7y.png
However, on a different note,
Google Chrome
The text appears but it's not displayed in black font color https://i.sstatic.net/nZp53.png
I'm encountering this rendering issue. There are no overriding styles in my styles.css
.
Can anyone provide the necessary css
to ensure that the select
tag renders consistently across all browsers?