Skip to content

fix(Tabs): Home/End, one key manager, navigate and select by key - #306

Merged
xidedix merged 1 commit into
v5.7from
fix/tabs-list-keyboard
Oct 16, 2026
Merged

xidedix merged 1 commit into
v5.7from
fix/tabs-list-keyboard

Conversation

@xidedix

@xidedix xidedix commented Oct 16, 2026

Copy link
Copy Markdown
Member

Keyboard and selection fixes in c-tabs-list, cTab and c-tab-panel.

Home and End now move focus to and select the first and last enabled tab; onKeyDown passed only the arrows to the key manager. The list keeps one FocusKeyManager on the tabs signal and destroys it with the list. Direction is read at keydown.

Keys start from the tab that holds the event target, so the arrows no longer drift after a click or an external activeItemKey, and keys from anything else inside the list are left alone.

A tab is selected when activeItemKey === itemKey, whatever its disabled state, as in vanilla, React and Vue: a disabled selected tab stays active and aria-selected and its panel stays shown. Before, the panel could hide every panel after a click and a tab list change moved the key to the first enabled tab. Without a key the list still selects the first enabled tab, or the first tab when all are disabled.

- Home/End move focus to and select the first/last enabled tab;
  onKeyDown passed only the arrows to the key manager
- one FocusKeyManager on the tabs signal, destroyed with the list; was a
  new manager and change subscription per tab list or direction change
  (4 managers, 0 destroyed after a render, two list changes and a
  direction change); direction read at keydown
- keys start from the tab holding the event target: arrows no longer
  drift after a click or an external activeItemKey; keys from non-tab
  elements in the list are left alone
- a tab is selected when activeItemKey === itemKey whatever its disabled
  state, as in vanilla, React and Vue: a disabled selected tab stays
  active and aria-selected and its panel stays shown; the panel no longer
  hides every panel after a click, a tab list change no longer moves the
  key off a disabled selected tab
- without a key the list selects the first enabled tab, or the first tab
  when all are disabled
@xidedix
xidedix merged commit e3cfaf3 into v5.7 Oct 16, 2026
9 checks passed
@xidedix
xidedix deleted the fix/tabs-list-keyboard branch October 16, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant