I use this "empty optgroup " workaround so that iOS displays option elements with long text in a readable way. To test this solution, I use the following code:
<p>Choose something:</p> <select> <option>Option A</option> <option>Some other option which is much longer than the first two options that has a distinguising feature at the end: B!</option> <option>Some other option which is much longer than the first two options that has a distinguising feature at the end: C!</option> <option>Option D</option> <option>Option E</option> <option>Option F</option> <option>Option G</option> <optgroup label=""></optgroup> </select>
optgroup { display: none; }
This makes iOS Safari display long options, so they are distinguishable again, but this opens up another problem when multiple items appear as though this is a single drop down menu.
Playback:
Note that option "A" is now selected.
- Scroll down in the native drop down menu until βOption Aβ is no longer visible.
- Press to select "Option E".
- Scroll back a bit.
The end result is that two options are selected:

The expected result, obviously, is that only "E" is selected.
How can I solve this problem?
source share