Feature Request: React BubbleMenu - own portal container and custom styling to menuEl #6111
Replies: 1 comment
-
I've been wrestling with that myself because I'm trying to animate the entrance/edit with framer motion. and ended up forking and making own BubbleMenuPlugin. One challenge that I ran into with not having menuEl created beforehand is the measurements were off from computePosition.
I was able to get around it by stripping the BubbleMenuPlugin's ability to add/remove styles. Now it just passes them in callbacks.
Then in BubbleMenuPlugin.ts-
This at least lets the BubbleMenu react component know that mounting/unmounting is happening. The next step would be to hold off on unmounting it and tearing down the bubbleMenuElement in the onAnimationEnd event instead of immediately. I do think that the if we can put more control into the react component, that would be more ideal. |
Beta Was this translation helpful? Give feedback.
-
Description
Define custom container for createPortal
Define props for menuEl.
Perhaps it is not necessary to create menuEl at all, but to use the ref directly on the div here https://github.com/ueberdosis/tiptap/blob/next/packages/react/src/menus/BubbleMenu.tsx#L66
Use Case
createPortal to document.body, for example.
Give menuEl custom styles such as transitions
Type
New feature
Beta Was this translation helpful? Give feedback.
All reactions