-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
fix(chips): focus not restored properly if chip has been removed by click #12788
fix(chips): focus not restored properly if chip has been removed by click #12788
Conversation
This comment has been minimized.
This comment has been minimized.
5c1a972
to
eef6a1e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This comment has been minimized.
This comment has been minimized.
eef6a1e
to
a9fcf08
Compare
CLAs look good, thanks! |
Hi @devversion! This PR has merge conflicts due to recent upstream merges. |
…lick * Currently if someone tries to remove a chip by clicking the `[matChipRemove]`, the click event will bubble up to the potential `MatFormField` and cause the `onContainerClick` to be invoked. This causes the focus to be always moved to the first chip (which is not good for accessibility). * Replaces multiple subscriptions in the chip list with a `takeUntil`. Also fixes that the chip remove subscription is re-created multiple times but not cleaned up. * Simplifies and cleans up the logic to restore focus after a chip has been destroyed. PR is based on: angular#12416
a9fcf08
to
93c4b1f
Compare
@jelbourn Rebased. |
…lick (#12788) * Currently if someone tries to remove a chip by clicking the `[matChipRemove]`, the click event will bubble up to the potential `MatFormField` and cause the `onContainerClick` to be invoked. This causes the focus to be always moved to the first chip (which is not good for accessibility). * Replaces multiple subscriptions in the chip list with a `takeUntil`. Also fixes that the chip remove subscription is re-created multiple times but not cleaned up. * Simplifies and cleans up the logic to restore focus after a chip has been destroyed. PR is based on: #12416
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Currently if someone tries to remove a chip by clicking the
[matChipRemove]
, the click event will bubble up to the potentialMatFormField
and cause theonContainerClick
to be invoked. This causes the focus to be always moved to the first chip (which is not good for accessibility).Replaces multiple subscriptions in the chip list with a
takeUntil
. Also fixes that the chip remove subscription is re-created multiple times but not cleaned up.Simplifies and cleans up the logic to restore focus after a chip has been destroyed.
Small demo that shows the issue in plain Angular: https://stackblitz.com/edit/chip-list-event-bubble-demo
NOTE: PR is based on: #12416