-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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 modal event listeners #37128
Fix modal event listeners #37128
Conversation
Add a check to ensure that the element that triggered the event is still present in the DOM.
@jbroutier Thank you for your PR. |
@GeoSot I've added a test case as requested. I've also updated the fix to check both events instead of just the mousedown one for testability purposes. Otherwise in one case I cannot trigger the event handler of the modal and in the other case I cannot reproduce the bug. |
I've linted a bit, but got another idea too. if (this._element !== event.target || this._element !== event2.target) {
return
} it should work too and it covers both cases |
Add a check to ensure that the element that triggered the event is still present in the DOM.
closes #37126
Supersedes #37143