First <sl-option>
in <sl-select>
is still highlighted when disabled
#2342
Labels
bug
Things that aren't working right in the library.
Describe the bug
In an
<sl-select>
, the first<sl-option>
element will still be highlighted / focused if it is disabled through thedisabled
attribute.With its styling being the same as an enabled option while in focus, the end user is unable to distinguish it from an enabled option without navigating to a different option.
The expected behavior, in my opinion, would be to focus the first enabled option instead.
I want to highlight that in it is not possible to focus disabled options in standard HTML (Chrome, Firefox), and that the first enabled option is selected by default.
To Reproduce
Steps to reproduce the behavior:
<sl-option>
in an<sl-select>
(see Demo)<sl-select>
inputDemo
Adapted from an example in the docs: https://codepen.io/re1/pen/wBwjBLb.
Screenshots
The first option is highlighted while being disabled. It is not possible to select it, it shows the disabled icon, and it is styled correctly when not highlighted.
Browser / OS
Additional information
A colleague reported this as a bug in our application, stating the behavior as "unexpected" and "confusing". They also suggested that the first enabled option should be highlighted instead. I asked on Discord about this and was told to create an issue to discuss this.
The text was updated successfully, but these errors were encountered: