react-contexify icon indicating copy to clipboard operation
react-contexify copied to clipboard

Option to append context menu to the end of the DOM

Open godsamit opened this issue 4 years ago • 1 comments

Hi, I was using version 4 looking to upgrade to version 5. I noticed that in version 5 the context menu gets appended to the parent node instead of the end of the DOM.

I basically have a page set up with react-collapse-pane, and I need a context menu for each pane. The pane is set up with position: absolute and since the context menu gets appended as a child for each pane, the pane seams, and the next pane will render over the context menu.

I'm hoping that there is a way to append it to the end of the DOM like it used to. In the meantime is there still documentation for the older version online?

godsamit avatar Mar 23 '21 05:03 godsamit

So I realized v5 removed the React Portal. I basically copied the portal from the previous version and wrapped all Menu with Portal like they were in v4.

I'm assuming it was removed as a design choice. Pls close this if you think it's trivial. Otherwise I'd be happy to do a PR to have this as a prop.

godsamit avatar Apr 01 '21 09:04 godsamit

Hey @godsamit, I finally managed to get some time to work on the library again. I'm working on the next major release. Portal has been removed in v5 but there is an example in the documentation on how to use it with portal https://fkhadra.github.io/react-contexify/mount-menu-at-specific-place. I'll make it more obvious with the new version

fkhadra avatar Nov 03 '22 19:11 fkhadra