-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(chips): default click action on chip being prevented #12856
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
Conversation
a443df6
to
737aec8
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
737aec8
to
812f213
Compare
Looks like the PR branch needs to be re-sync'd to pick up d527e48? |
let currentElement = event.target as HTMLElement | null; | ||
|
||
while (currentElement && currentElement !== this._elementRef.nativeElement) { | ||
if (currentElement.classList.contains('mat-chip')) { |
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.
shouldn't we also check if it originates from the chip input?
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.
That's not necessary, because the focus
method checks whether the input is focused.
When trying to sync this PR into google, I found I need to do the following to make them pass:
We can take a 2 step approach with the first step just to fix the default event handler bug, and handle the even propagation later since we will need to fix the broken test cases first. |
812f213
to
bb520e3
Compare
@vivian-hu I've switched it back to always stop propagation. The important change in this PR is that we call |
bb520e3
to
289de51
Compare
Fixes all the click actions on a chip being prevented. The action wasn't being prevented up until c82aca9 where it got moved out of the `if (this.disabled)`. Since there isn't any info or tests around why it was done this way, I'm assuming that it was by accident. Fixes angular#9032.
289de51
to
8463c2d
Compare
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. |
Fixes all the click actions on a chip being prevented. The action wasn't being prevented up until c82aca9 where it got moved out of the
if (this.disabled)
. Since there isn't any info or tests around why it was done this way, I'm assuming that it was by accident.Fixes #9032.