varia icon indicating copy to clipboard operation
varia copied to clipboard

Arrow Navigation on Tabs etc should be optional

Open LinusBorg opened this issue 5 years ago • 0 comments

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

  1. add prop to the ArrowNavigation Props, i.e. disableArrowNav. We shouldn't use a more generic disabled as that's taken for disablding components completely, i.e. <Button disabled>
  2. add a matching option to the ArrowNavOptions
  3. change implementation in useArrowNavigation() so that isActiveis computed from hasFocus.value && !options.disableArrowNav

LinusBorg avatar May 22 '20 11:05 LinusBorg