"disabled" options are still used by autocomplete
See original GitHub issueIf I have a select field like this:
<select name="test" id="test">
<option value="">Select...</option>
<option value="a">A</option>
<option value="b" disabled>B</option>
<option value="c">C</option>
</select>
And enable autocomplete like this:
<script>
accessibleAutocomplete.enhanceSelectElement({
defaultValue: '',
selectElement: document.querySelector('#test')
});
</script>
Then if I type “B” in the autocomplete input field, B is chosen. I would expect it to not be available.
(I can imagine there might be good reasons why gov.uk doesn’t use disabled
– maybe it’s poor accessibility? Some other reason? In which case I understand why this doesn’t support the option 😃 But as an outsider using this otherwise excellent tool, this was unexpected behaviour.)
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Material-UI Autocomplete disable options present in array
Let's say that I have an array that I am dynamically generating of timeSlots that I would like to disable, timeSlotsArr , how...
Read more >jQuery UI Autocomplete disabled Option - GeeksforGeeks
jQuery UI Autocomplete disabled option when set to true, will disable the menu. Default value is False. Syntax:.
Read more >React Autocomplete component - Material UI - MUI
The autocomplete is a normal text input enhanced by a panel of suggested options. The widget is useful for setting the value of...
Read more >Hide autocomplete options panel on disabled or add ... - GitHub
Hide the options panel of autocomplete if the input element goes disabled. Or add a method to hide the panel in an official...
Read more >Disabled Items - AutoComplete - Kendo UI for Angular - Telerik
The AutoComplete allows you to disable some of its options and prevent the user from interacting with them. The following example demonstrates how...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@philgyford We’re prioritising bug fixes over new feature development for the accessible autocomplete right now so we won’t be able to work on this at the moment. But thanks for flagging it, it’s good to have it recorded 👍
@philgyford I designed the original Accessible Autocomplete together with @tvararu.
I don’t think we explicitly didn’t support it so much as not building for it as it wasn’t a priority or used by GOV.UK. In other cases where services can’t control the markup we’ve provided some disabled styles -but in this case we’d have expected the service must have control of the markup so can avoid disabled, etc.
The sorts of selects you get in government services don’t generally have need for disabled items (clothing sizes out of stock, etc)
@nickcolley I assume the preferred solution would be for the disabled options to still be shown, but somehow indicated as not selectable.
I can see good reasons why someone might want a disabled option - though it might take some work - as you’d need to work out how to communicate to this to AT, and handle focus keyboard movement through the options.