question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

onCellContextMenu preventDefault still shows browser context menu.

See original GitHub issue

Trying to add a right click menu to my implementation of the glide data grid and can’t get the browser context menu not to show.

onCellContextMenu={(e, y) => {
    y.preventDefault()
    ...
}}

Doesn’t seem to do anything?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jassmithcommented, Jul 19, 2022

Okay I figured out the problem, the menu on MacOS comes up immediately on mouseDown but on windows it waits for mouse up. I will figure out a solution, this makes it non-trivial.

0reactions
jassmithcommented, Jul 20, 2022

Fixed in 5.0.0 for real this time

Read more comments on GitHub >

github_iconTop Results From Across the Web

onCellContextMenu does not prevent event default #2182
This completely halted my migration to ag-grid since i cannot continue without implementing a right click custom context menu.
Read more >
Prevent context menu from opening on a right click over ...
Event.preventDefault() works, but may produced error/restriction sounds on some browsers (e.g. Chrome) and since you plan to implement a custom ...
Read more >
Browser default contextmenu also appears on ...
I'm trying to prevent the default contextmenu of the browser when right clicking on the diagram. Otherwise, the context template I ...
Read more >
Element: contextmenu event - Web APIs | MDN
The contextmenu event fires when the user attempts to open a context menu. This event is typically triggered by clicking the right mouse ......
Read more >
How to prevent displaying browser context menu when ...
Hello DevExpress support team, i want to use a dxContextMenu just on specific custom demands. I planed to register such a dxContextMenu in ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found