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

[feat]: Update roving-tabindex-controller key handling based on based on grid, tree, and listbox roles #2556

Open
nikkimk opened this issue Jul 14, 2023 · 0 comments
Assignees
Labels
accessibility Improve accessibility feature New feature or request

Comments

@nikkimk
Copy link
Collaborator

nikkimk commented Jul 14, 2023

Needed for any components that will be using a grid, tree, and listbox. For example, search, dropdown, and autocomplete

Keyboard navigation for grid, tree, and listbox

All three

  • up arrow: moves to previous item in horizontal listbox, node in tree, or row in grid
  • down arrow: moves to next item in horizontal listbox, node in tree, or row in grid
  • home (optional): moves to first item in a listbox, node in tree, or gridcell in a row
  • end (optional): moves to last item in a listbox, node in tree, or gridcell in a row

Listbox-specific keyboard interaction

  • When a single-select listbox receives focus:
    • If none of the options are selected before the listbox receives focus, the first option receives focus. Optionally, the first option may be automatically selected.
    • If an option is selected before the listbox receives focus, focus is set on the selected option.
  • When a multi-select listbox receives focus:
    • If none of the options are selected before the listbox receives focus, focus is set on the first option and there is no automatic change in the selection state.
    • If one or more options are selected before the listbox receives focus, focus is set on the first option in the list that is selected.
  • left arrow: moves to previous item in vertical listbox
  • right arrow: moves to next item in vertical listbox
  • Type-ahead is recommended for all listboxes, especially those with more than seven options:
    • Type a character: focus moves to the next item with a name that starts with the typed character.
    • Type multiple characters in rapid succession: focus moves to the next item with a name that starts with the string of characters typed.

Tree keyboard interaction

  • For a vertically oriented tree:
    • When a single-select tree receives focus:
      • If none of the nodes are selected before the tree receives focus, focus is set on the first node.
      • If a node is selected before the tree receives focus, focus is set on the selected node.
  • When a multi-select tree receives focus:
    • If none of the nodes are selected before the tree receives focus, focus is set on the first node.
    • If one or more nodes are selected before the tree receives focus, focus is set on the first selected node.
  • left arrow: when focus is on a closed node, opens the node; when focus is on an open node, moves focus to the first child node.
  • right arrow: when focus is on an open node, closes the node; when focus is on a child node that is also either an end node or a closed node, moves focus to its parent node.
  • * (optional): Expands all siblings that are at the same level as the current node.
  • Type-ahead is recommended for all trees, especially for trees with more than 7 root nodes:
  • Type a character: focus moves to the next node with a name that starts with the typed character.
  • Type multiple characters in rapid succession: focus moves to the next node with a name that starts with the string of characters typed.

Grid keyboard interaction

  • left arrow: moves to previous gridcell in grid
  • right arrow: moves to next gridcell in grid
  • pageDown (optional): moves focus down an author-determined number of rows, typically scrolling so the bottom row in the currently visible set of rows becomes one of the first visible rows. If focus is in the last row of the grid, focus does not move.
  • pageUp (optional): moves focus up an author-determined number of rows, typically scrolling so the top row in the currently visible set of rows becomes one of the last visible rows. If focus is in the first row of the grid, focus does not move.
  • ctrl+home (optional): moves focus to the first cell in the first row.
  • ctrl+end (optional): moves focus to the last cell in the last row.

Impacted component(s)

  • roving-tabindex-controller
  • future field components using grid, tree, and listbox roles
  • will need to make sure changes don't affect existing components that use roving-tabindex-controller

Related issues

@nikkimk nikkimk added feature New feature or request accessibility Improve accessibility labels Jul 14, 2023
@nikkimk nikkimk changed the title Update roving-tabindex-controller key handling based on based on grid, tree, and listbox roles [feat]: Update roving-tabindex-controller key handling based on based on grid, tree, and listbox roles Jul 14, 2023
@nikkimk nikkimk self-assigned this Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Improve accessibility feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant