Repository navigation
feat(core): keyboard navigation for List menus and submenus - #600
Conversation
|
|
|
Thanks, @Saisinare! This follows the menu pattern closely, and the play covers every keyboard step. Leaving Esc on the top menu to whatever opened it is a nice touch. One thing: clicking an item focuses it, and '&:hover, &:focus-visible, &[aria-expanded="true"]': {and the same for Also, could you drop the |
15e6707 to
0287094
Compare
|
Thanks for the review! Switched both to |
List's submenus only opened on CSS :hover, so they could not be reached with the keyboard. List now follows the WAI-ARIA menu pattern: - role="menu" on lists, role="menuitem" on items, role="separator" on dividers; items with a submenu get aria-haspopup and aria-expanded - a single tab stop for the menu (roving tabindex), with Up/Down to move between items, wrapping around, and Home/End to jump to the ends - Right (or Enter/Space) opens a submenu and moves into it; Left or Esc closes it and returns to its item - Enter/Space on an item without a submenu clicks it, so onClick runs as it does for the mouse Hover keeps working as before, and the TaskBar start menu is unchanged. List > With Icons tests the keyboard steps in its play function, and List > Simple tests that Enter and Space click the focused item. Closes React95#566
0287094 to
8ebb658
Compare
|
View your CI Pipeline Execution ↗ for commit 8ebb658
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
|
Thanks, @Saisinare! The List menus can now be used with the keyboard, submenus included. 🎉 @all-contributors please add @Saisinare for code and a11y |
|
I've put up a pull request to add @Saisinare! 🎉 |
List's submenus only opened on CSS :hover, so they could not be reached with the keyboard. List now follows the WAI-ARIA menu pattern:
Hover keeps working as before, and the TaskBar start menu is unchanged. List > With Icons tests the keyboard steps in its play function, and List > Simple tests that Enter and Space click the focused item.
Closes #566