html icon indicating copy to clipboard operation
html copied to clipboard

select element sizing should ignore optgroup labels

Open heycam opened this issue 6 years ago • 2 comments

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

heycam avatar Apr 03 '19 21:04 heycam

See also #4481.

annevk avatar Apr 05 '19 12:04 annevk

The optgroup label should be ignored when computing the width of a drop-down select, but not for a listbox select.

zcorpan avatar Aug 11 '22 20:08 zcorpan