html
html copied to clipboard
select element sizing should ignore optgroup labels
Testing shows that the label of an optgroup does not contribute to the intrinsic size of a select element, in Chrome and Safari. For example:
<select>
<optgroup label="Some long label that has no effect.">
<option>First</option>
<option>Second</option>
</optgroup>
</select>
In Firefox the select element is wide enough to fit the optgroup label, and in Chrome and Safari it is wide enough to fit "Second".
This is a Web compatibility issue for us: https://bugzilla.mozilla.org/show_bug.cgi?id=1526855
See also #4481.
The optgroup label should be ignored when computing the width of a drop-down select, but not for a listbox select.