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

bug(MatChipGrid): Focus order is not logical #29359

Closed
1 task
clamli opened this issue Jul 1, 2024 · 0 comments · Fixed by #29364
Closed
1 task

bug(MatChipGrid): Focus order is not logical #29359

clamli opened this issue Jul 1, 2024 · 0 comments · Fixed by #29364
Assignees
Labels
Accessibility This issue is related to accessibility (a11y) area: material/chips G This is is related to a Google internal issue P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@clamli
Copy link
Contributor

clamli commented Jul 1, 2024

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

Multiple labels are added in a custom grid. The order in which focusable elements receive focus in the grid is not logical. The RIGHT and LEFT ARROW keys move right and left, but the DOWN and UP ARROW keys also move right and left. This is acceptable for users who can see the structure, but for screen reader users it interferes with understanding the grid structure.

Ensure that the order in which elements receive keyboard focus follows a meaningful and logical sequence. DOWN ARROW and UP ARROW should only move between logical rows of the filter grid, as in the ARIA APG pattern.

Reproduction

StackBlitz link: https://stackblitz.com/run?file=package.json
Steps to reproduce:

  1. Navigate through the chips with input example
  2. Notice that RIGHT and LEFT ARROW keys have the same effect as the DOWN and UP ARROW keys

Expected Behavior

DOWN and UP ARROW keys should move the focus from

Lemon -> Lime -> Apple

Actual Behavior

DOWN and UP ARROW keys moves the focus from

Lemon -> Close icon (Lemon) -> Lime -> Close icon (Lime) -> Apple -> Close icon (Apple)

Environment

  • Angular:
  • CDK/Material:
  • Browser(s):
  • Operating System (e.g. Windows, macOS, Ubuntu):
@clamli clamli added the needs triage This issue needs to be triaged by the team label Jul 1, 2024
@crisbeto crisbeto self-assigned this Jul 2, 2024
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent G This is is related to a Google internal issue area: cdk/a11y Accessibility This issue is related to accessibility (a11y) area: material/chips and removed needs triage This issue needs to be triaged by the team area: cdk/a11y labels Jul 2, 2024
crisbeto added a commit to crisbeto/material2 that referenced this issue Jul 2, 2024
Currently the up/down arrows behave in the same way as left/right, however that's incorrect based on [the reference implementation](https://www.w3.org/WAI/ARIA/apg/patterns/grid/examples/layout-grids/#ex2_label) which shows them navigating between the rows.

These changes update the logic in the chip grid so that it matches the expected behavior.

Fixes angular#29359.
crisbeto added a commit that referenced this issue Jul 3, 2024
Currently the up/down arrows behave in the same way as left/right, however that's incorrect based on [the reference implementation](https://www.w3.org/WAI/ARIA/apg/patterns/grid/examples/layout-grids/#ex2_label) which shows them navigating between the rows.

These changes update the logic in the chip grid so that it matches the expected behavior.

Fixes #29359.

(cherry picked from commit 0519174)
crisbeto added a commit that referenced this issue Jul 3, 2024
Currently the up/down arrows behave in the same way as left/right, however that's incorrect based on [the reference implementation](https://www.w3.org/WAI/ARIA/apg/patterns/grid/examples/layout-grids/#ex2_label) which shows them navigating between the rows.

These changes update the logic in the chip grid so that it matches the expected behavior.

Fixes #29359.

(cherry picked from commit 0519174)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accessibility This issue is related to accessibility (a11y) area: material/chips G This is is related to a Google internal issue P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants