Skip to content

Conversation

@Edouard-Tby
Copy link
Contributor

…t-click

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

[X] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

When right-clicking on an edge, the custom context menu appears but the default browser context menu also shows up, causing UI overlap and unintended behavior.

Issue Number: 346

What is the new behavior?

Right-clicking on an edge now only opens the custom context menu.
The default browser context menu is suppressed using preventDefault() in the onContextMenu handler, and event propagation is stopped to prevent interference from other scene elements.

Does this PR introduce a breaking change?

[ ] Yes
[X] No

Other information

onPointerDown fires before contextmenu, but the browser doesn’t care unless you also stop the contextmenu event.
onContextMenu directly intercepts the event that causes the browser menu.
event.preventDefault() removes the default menu, and event.stopPropagation() keeps it from triggering higher-level handlers.

@netlify
Copy link

netlify bot commented Aug 12, 2025

Deploy Preview for reagraph ready!

Name Link
🔨 Latest commit ef0ab38
🔍 Latest deploy log https://app.netlify.com/projects/reagraph/deploys/689b934e21b8aa000820b2a2
😎 Deploy Preview https://deploy-preview-363--reagraph.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@AntonJames-Sistence AntonJames-Sistence left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and works on my machine in Chrome and Safari. However, I don’t have access to a Windows environment to test it there

@amcdnl amcdnl merged commit b573bb1 into reaviz:master Aug 13, 2025
5 checks passed
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.

3 participants