While updating :focus states on Apex widgets, disabled PHP DropdownInputWidget grabbed my focus:
We're currently, as of v0.22.3, delivering following output:
<div aria-disabled="true" id="ooui-168" class="oo-ui-widget oo-ui-widget-disabled oo-ui-inputWidget oo-ui-dropdownInputWidget oo-ui-dropdownInputWidget-php" data-ooui="{"_":"OO.ui.DropdownInputWidget","options":[],"inputId":"ooui-34","disabled":true}"> <select tabindex="-1" aria-disabled="true" disabled="disabled" id="ooui-34" class="oo-ui-inputWidget-input oo-ui-indicator-down"></select> </div>
The select element carries tabindex="-1" aria-disabled="true" disabled="disabled"
There are various issues with this combination:
- The easy-to-fix one would be removing redundancy. If we think disabled is the right way to go, there's no need to set tabindex=-1 nor [[ https://www.powermapper.com/products/sortsite/rules/w3chtml5ariaattrwithnativeattr-disabled/ | aria-disabled=true ]].
- A bigger issue might be a mislead underlying concept of “disabledness”.
disabled=true attribute implies that an element isn't focusable at all and browsers won't fire attached events.
Depending on the context, it can be important to have focusable disabled elements with only aria-disabled=true applied, which will be only read “dimmed” to screenreader users.
Thinking of forms with process steps where it's useful to give feedback what's disabled instead of just jumping to the next enabled widget.