varia
varia copied to clipboard
Arrow Navigation on Tabs etc should be optional
Problem
In some situations, users expect tabs to be navigatable by tabs, not arrow keys. Sinc we, so war, force arrow key navigation for composite widgets like tabs, listboxes and so forth, we currently don't give developers a tool to cater to these situations.
Solution
We keep the default behaviour of active arrow navigation, but provide developers with an easy way to disable arrow navigation for any control that offers its, which gives them the opportunity to design their UI elements with this in mind where necessary.
The solution should not be limited to specific components but instead be embedded in the arrow navigation abstraction so developers have flexibility to decide in all of the components using it.
Design
- add prop to the ArrowNavigation Props, i.e.
disableArrowNav. We shouldn't use a more genericdisabledas that's taken for disablding components completely, i.e.<Button disabled> - add a matching option to the ArrowNavOptions
- change implementation in
useArrowNavigation()so thatisActiveis computed fromhasFocus.value && !options.disableArrowNav