storybook-eol/react-treebeard

How to handle right click events over folders and nodes (files)?

rubencg195 opened this issue · 4 comments

I want to display custom dropdown menus when a right-click event is detected over a node or folder. The toggle event apparently is only triggered by the left click. How can I get the node information when it has been right-clicked?

Well, I guess you could provide you own decorator e.g. Container and put whatever handler you want in it...

Thanks @Tomassito. What I still do not know is how to detect the right click event? You provide a trigger event called onToggle for left click events but not for right click events.

If this is the problem then I suggest you to consult the Web API
https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent

@rubencg195 , did you implement right click event? if yes, can you share the code snippet?