Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reactToKeys prop to Toc component and on_keydown handler to enable navigating ToC with keyboard #55

Merged
merged 4 commits into from Mar 21, 2024

Conversation

janosh
Copy link
Owner

@janosh janosh commented Mar 21, 2024

  • document new prop reactToKeys: reactToKeys: string[] = [`ArrowDown`, `ArrowUp`, ` `, `Enter`, `Escape`, `Tab`] in readme
  • add tests for ToC keyboard navigation

…`, `ArrowUp`, ` `, `Enter`, `Escape`, `Tab`]
arrow keys navigate the active ToC on mobile item when open=%s

Escape key closes ToC on mobile if reactToKeys=%s includes 'Escape'
@janosh janosh added enhancement New feature or request testing Test all the things ux User experience labels Mar 21, 2024
@janosh janosh merged commit 9468c7c into main Mar 21, 2024
4 checks passed
@janosh janosh deleted the keyboard-navigation branch March 21, 2024 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request testing Test all the things ux User experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant