vkbansal/react-contextmenu

How to close react-context menu on document scroll?

Closed this issue · 3 comments

Thanks for the awesome context menu.

I have opened the context menu on elements which are inside a scroll able div.
Now i want to close the context Menu when I scroll the div.
Please help
demo

You can add a scroll listener on the element and call hideMenu from react-contextmenu/lib/actions

Thanks alot it worked
it is in react-contextmenu/src/actions
not react-contextmenu/lib/actions

I used it Like
import { hideMenu } from "react-contextmenu/src/actions";

This worked for me...

import { hideMenu } from "react-contextmenu"