react-datasheet-grid icon indicating copy to clipboard operation
react-datasheet-grid copied to clipboard

Wrong behaviour when showing Context Menu

Open lucasbozzo opened this issue 3 years ago • 4 comments
trafficstars

Hey, I'm currently facing an issue with context menu which I'm not able to find the reason or solution. I hope you are able to give me some lights on this issue.

Behaviour When I click anywhere in the spreadsheet for the first time, the browser's context menu appears. Following clicks show the Spreadsheet's context menu correctly. Wrong context menu Correct context menu

Expected behaviour Show Spreadsheet context menu every time the user right clicks anywhere in the spreadsheet.

Browser It seems to happen with Edge and Chrome

Operating system Windows 11 Enterprise

lucasbozzo avatar May 17 '22 10:05 lucasbozzo

Hey @lbozzo , I cannot reproduce the issue (Mac OS, multiple browsers), so I am assuming it is a windows thing? Is the window in focus when you first right-click?

nick-keller avatar Jun 01 '22 07:06 nick-keller

Hey @nick-keller , I managed to replicate it consistently. Yes, it seems to happen only on Windows and it happens when the cursor is moved right after the right-click. It's more common for example with a trackpad, as it is normal to move the fingers a bit after clicking.

I might be wrong, but I created a sandbox with a normal div and I used both event.preventDefault() and event.stopImmediatePropagation() with the idea of blocking any other listeners (and maybe even the browser) of that same event and it seemed to work.

lucasbozzo avatar Jun 01 '22 23:06 lucasbozzo

Hey @lbozzo can you help me please. I know this isn't the place to ask for help but I will really appreciate your kind response. Those images you shared, I can see you used select many times. Can you please explain how you did that or share code snippet ? I have followed there documentation https://react-datasheet-grid.netlify.app/docs/examples/implementing-select but I got stuck because there final version was missing something. I am also creating similar app like yours.

zaryabdev avatar Jul 15 '22 14:07 zaryabdev

@zaryabdev sure, I would like to help you but I'm not able to share code snippets as this is confidential. We might discuss it outside this thread or in the Discussion section.

lucasbozzo avatar Jul 22 '22 09:07 lucasbozzo