-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(google-maps): update right-click event to use contextmenu for Adv… #30523
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
base: main
Are you sure you want to change the base?
Conversation
Thinking about this more, I believe google maps natively block the default context menu within the component, am I correct in that belief? Or should I be adding I don't understand google-maps & map-advanced-marker interactions enough to make the change within map-advanced-marker itself without some feedback. |
I am not sure about that. We have a page to test it in our dev app ( |
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.
updating review status to reflect request above
cee6bce
to
3c2a592
Compare
3c2a592
to
6186b1a
Compare
By rewriting the prototype of the advancedmarker and inject functionality for right clicking there.We have a cleaner and more native event management within the component and fix issues surrounding different ways contextmenu is supported across browsers.
6186b1a
to
f7cdfc6
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
'rightclick' never triggers on advanced marker elements. nor within on gmp-click, as right-click events have been disabled for some reason on advanced markers within JS Maps.
This assumes that contextmenu is being opened via right clicking of a mouse, which is 99% of use cases. We can rename the emitter as well if deemed necessary to truly fit context, but I wanted to maintain backwards compatibility with and uniformity between the two.