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): The focus indicator is not displayed for the chip grid when navigating through a MatChipGrid component the second time #29785

Closed
1 task
clamli opened this issue Sep 24, 2024 · 0 comments · Fixed by #29793
Assignees
Labels
Accessibility This issue is related to accessibility (a11y) area: material/chips 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 Sep 24, 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

The focus indicator is not displayed for the chip grid when navigating through a MatChipGrid component the second and subsequent time.

Reproduction

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

  1. Go to https://material.angular.io/components/chips/overview#chips-input
  2. Tab through this MatChipGrid example
  3. Click anywhere on the page to reset the focus
  4. Tab through the example again
  5. Notice that the focus indicator is not rendered around the chip grid the second time

Expected Behavior

The focus indicator should always be displayed around the chip grid when navigating through.

Actual Behavior

The focus indicator is not rendered around the chip grid the second (and subsequent) time.

Environment

  • Angular:
  • CDK/Material: 18.2.5
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS
@clamli clamli added the needs triage This issue needs to be triaged by the team label Sep 24, 2024
@amysorto amysorto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent Accessibility This issue is related to accessibility (a11y) area: material/chips and removed needs triage This issue needs to be triaged by the team labels Sep 24, 2024
@crisbeto crisbeto self-assigned this Sep 26, 2024
crisbeto added a commit to crisbeto/material2 that referenced this issue Sep 26, 2024
There was some logic that assumed that if a chip is the active item in the key manager, it must have focus. That's incorrect since the active item isn't reset on blur. This prevented the chip grid from re-focusing the first chip when the user tabs into it a second time.

These changes add a `focus` call whenever the grid receives focus.

Fixes angular#29785.
crisbeto added a commit that referenced this issue Sep 30, 2024
There was some logic that assumed that if a chip is the active item in the key manager, it must have focus. That's incorrect since the active item isn't reset on blur. This prevented the chip grid from re-focusing the first chip when the user tabs into it a second time.

These changes add a `focus` call whenever the grid receives focus.

Fixes #29785.

(cherry picked from commit 2861a30)
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 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.

3 participants