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

Send mouse events that bubble across shadow DOM #3509

Merged
merged 1 commit into from
Mar 3, 2020

Conversation

tbodt
Copy link
Contributor

@tbodt tbodt commented Feb 28, 2020

The latest version of Gerrit has been redesigned so that the link elements don't actually handle mouse events. They're instead handled by other elements a few layers of shadow DOM up. Events created by initMouseEvent don't have composed set, so they won't bubble up shadow DOM. This sets composed using the MouseEvent constructor.

Also initMouseEvent is deprecated according to MDN.

Link: https://fuchsia-review.googlesource.com/

This fixes clicking on buttons/links in the latest version of Gerrit.
@gdh1995
Copy link
Contributor

gdh1995 commented Feb 29, 2020

LGTM.

BTW, although https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/MouseEvent says this constructor only exists on Chrome 47+, in my tests Chrome 31 has supported it.

@philc philc merged commit 3a55b89 into philc:master Mar 3, 2020
@philc
Copy link
Owner

philc commented Mar 3, 2020

Nice fix, and readability improvement. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants