How to close contex menu when scrolling
if I click on a page and the contex menu opens i want it to close when i scroll the page. Is there a property to set where i hide the menu on scroll? Thank you
Hey @NemanjaS2P, this is already the default behavior.
https://user-images.githubusercontent.com/5574267/102987372-7c2d3f00-4512-11eb-8189-a19f7db10b9a.mov
If it's not your case, could you share the code in a code sanbox ? Thanks
Hey @NemanjaS2P, this is already the default behavior.
Screen.Recording.2020-12-23.at.11.31.02.AM.mov If it's not your case, could you share the code in a code sanbox ? Thanks
Open a custom scroll area to close the context-menu? It can't seem to work well in custom scroll area. See this code sanbox example: https://codesandbox.io/s/nifty-fermat-ljldf?file=/src/App.tsx:348-359
Hey @NemanjaS2P, this is already the default behavior. Screen.Recording.2020-12-23.at.11.31.02.AM.mov If it's not your case, could you share the code in a code sanbox ? Thanks
Open a custom scroll area to close the context-menu? It can't seem to work well in custom scroll area. See this code sanbox example: https://codesandbox.io/s/nifty-fermat-ljldf?file=/src/App.tsx:348-359
Yes I am able to reproduce this as well. We can make it sticky with scroll or it should have an option to automatically hide/close it.
I have the same problem. The property that causes this problem is:
height:calc(100vh - 52px);
and this is the full class applied on my page:
{
position: relative;
overflow-y: scroll;
overflow-x: hidden;
height: calc(100vh - 52px);
transition: all 0.5s ease-in-out;
}
As a workaround you could close the menu programmatically, for example, you can listen for the scroll on the target and then close the menu
target.addEventListener("scroll", () => contextMenu.hideAll())