Skip to content

fix(material/chips): focus not moved on destroy #31653

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

Merged
merged 1 commit into from
Aug 6, 2025

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Aug 6, 2025

We have some logic that moves focus if a chip is destroyed so that it doesn't go back to the body. The removal timing seems to have changed at some point which broke the focus restoration, because the element is blurred before it is destroyed.

These changes make the logic a bit more robust by checking the key manager for the removed chip.

We have some logic that moves focus if a chip is destroyed so that it doesn't go back to the `body`. The removal timing seems to have changed at some point which broke the focus restoration, because the element is blurred before it is destroyed.

These changes make the logic a bit more robust by checking the key manager for the removed chip.
@crisbeto crisbeto requested a review from a team as a code owner August 6, 2025 08:15
@crisbeto crisbeto requested review from andrewseguin and ok7sai and removed request for a team August 6, 2025 08:15
@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Aug 6, 2025
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Aug 6, 2025
@crisbeto crisbeto merged commit 4bf8ebf into angular:main Aug 6, 2025
36 of 37 checks passed
@crisbeto
Copy link
Member Author

crisbeto commented Aug 6, 2025

The changes were merged into the following branches: main, 20.1.x

crisbeto added a commit that referenced this pull request Aug 6, 2025
We have some logic that moves focus if a chip is destroyed so that it doesn't go back to the `body`. The removal timing seems to have changed at some point which broke the focus restoration, because the element is blurred before it is destroyed.

These changes make the logic a bit more robust by checking the key manager for the removed chip.

(cherry picked from commit 4bf8ebf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: material/chips target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants