Feature Request: Skip keyboard navigation of disabled options
See original GitHub issueCurrent results:
- When
isOptionDisabled
prop is present, it disables all selecting option value events (click, keyboard), but does not skip it’s focus via keyboard when clicking arrow keys up and down.
Expected results:
- If option is disabled, when navigating via keyboard it should skip it. The focus should go to another available option. Example, default select behavior: https://jsfiddle.net/zm7uanxo/1/
- It worked like this at least in v1 of the plugin, when I tried it.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:10
Top Results From Across the Web
Feature Request: Skip keyboard navigation of disabled ...
In my opinion focusing the disabled option provides no benefit. You can focus the option, but you cannot do any actions with it....
Read more >Skip Navigation Links - WebAIM
The key is to make sure the link is one of the first items that screen readers hear and that keyboard users navigate...
Read more >Keyboard Compatibility | Web Accessibility Initiative (WAI) - W3C
Who depends on this feature? People with physical disabilities who cannot use the mouse. People who are blind, and cannot see the mouse...
Read more >Mac accessibility shortcuts - Apple Support
Use your keyboard like a mouse ; Move the focus to the previous grouping of controls, Control-Shift-Tab ; Move to the adjacent item...
Read more >Keyboard-Only Navigation for Improved Accessibility
Mouse users can simply disregard the main navigation and interact directly with any of the links in the main content area. Offering a...
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
My proposal is to add a
skipDisabled
boolean prop that defaults tofalse
to maintain backwards compatibility.I can work on creating a pull request for this issue if this is okay.
I was looking into this and there’s actually a test that verifies disabled options to be focusable.
https://github.com/JedWatson/react-select/blob/master/packages/react-select/src/__tests__/Select.test.js#L806
I was wondering if this is really the expected behaviour because the native <select> element skips disabled options. It would be nice to give the user the ability to control skipping vs not skipping as we have a requirement to skip the disabled ones.
Edit: Looks like this was intended to apply accessibility to disabled options: #3445