LinusBorg / LinusBorg/varia

Arrow Navigation on Tabs etc should be optional

Open
#10 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
33
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## 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. ``
2. add a matching option to the ArrowNavOptions
3. change implementation in `useArrowNavigation()` so that `isActive`is computed from `hasFocus.value && !options.disableArrowNav`

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the ArrowNavigation Props, ArrowNavOptions, and useArrowNavigation() definitions. Trace how options reach isActive, then verify that disableArrowNav can be set for any control, disables arrow navigation when enabled, and preserves the current default behavior when omitted.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
accessibility, frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.