Skip to content

Add Tab and Shift+Tab focus navigation - #127

Open
cowboyd wants to merge 1 commit into
ui-keyboard-focusfrom
dom-tab-navigation
Open

cowboyd wants to merge 1 commit into
ui-keyboard-focusfrom
dom-tab-navigation

Conversation

@cowboyd

@cowboyd cowboyd commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

This PR is part of of the "Input Stack" which adds the following capabilities to the DOM

  • Focus management: focus(), blur(), activeElement, focus events, and cleanup when focused nodes are removed.
  • Focus navigation: Tab/Shift+Tab, tabindex ordering, wrapping, and disabled/inert filtering.
  • Focus styling: :focus, :focus-within, and :focus-visible under our keyboard-only policy.
  • Input editing: typing, replacing selections, Backspace/Delete, and cancelable beforeinput followed by input.
  • Caret movement: Left/Right across grapheme boundaries; Up/Down to the beginning/end of single-line inputs.
  • Shift-selection: extend, shrink, and reverse a selection while preserving its anchor. Readonly inputs allow movement and selection.
  • Input state APIs: value, selection endpoints/direction, setSelectionRange(), and setRangeText().

What does this PR do?

Adds cancelable Tab and Shift+Tab focus navigation with tabindex ordering, wrapping, and DOM-position traversal from elements outside the tab order.

Type of change

  • Bug fix
  • Feature
  • Refactor (no behavior change)
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • All tests pass (pnpm test)
  • Files are formatted (pnpm format)
  • I have added/updated tests for my changes (if applicable)
  • I have added a changeset

AI-generated code disclosure

  • This PR includes AI-generated code

@pkg-pr-new

pkg-pr-new Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

commit: 1d7926d

@cowboyd
cowboyd force-pushed the dom-tab-navigation branch from b523ee5 to 9e56c94 Compare December 1, 2026 18:08
@cowboyd
cowboyd force-pushed the dom-tab-navigation branch from 9e56c94 to daa27f3 Compare December 1, 2026 18:17
@cowboyd
cowboyd added this pull request to stack #114 December 1, 2026 18:53
@cowboyd
cowboyd force-pushed the dom-tab-navigation branch from daa27f3 to 3ca42c7 Compare December 1, 2026 18:58
@cowboyd
cowboyd force-pushed the dom-tab-navigation branch from 3ca42c7 to 1d7926d Compare December 1, 2026 19:40
@cowboyd
cowboyd marked this pull request as ready for review December 1, 2026 19:53
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