position issue with context menu inside scrolled area (floating-ui)

88 Views Asked by At

I want to build a context menu on right mouse click and anchor that menu to the clicked position in the scrolled area so that it will not be visible when scroll down. Here is a demo: https://codesandbox.io/p/sandbox/floating-ui-bubble-context-menus-ldyjpy?file=%2Fsrc%2Fcontext-menu.tsx%3A86%2C1

Try to select some text and scroll down - this works properly thanks to contextElement. However, for some reason the same does not work for context menu (on right click). Any ideas?

0

There are 0 best solutions below