Skip to content

Replacing domNode with editor element multiple times breaks editor bubble menu #1245

@nmajor

Description

@nmajor

Question

So this isn't likely a bug with html-react-parser. I'm trying to use it in combination with react createPortal and an editor library called tiptap. Basically I'm parsing some html and for specific elements replacing them with the tiptap editor. But whenever there are multiple replacements like this then it breaks the tiptab bubble menu.

I made a sandbox to demonstrate:
https://codesandbox.io/p/sandbox/tiptap-multiple-72sdkg

I only have this issue when I use html-react-parser to add multiple editors. Something is happening where it miscalculates the offsets of the bubble menu which is basically a tooltip.

My question is this:

Can you think of anything that could explain this miscalculation? Is there some kind of component memoization or caching that could make the tooltip (that powers the bubble menu of the editor) no calculate the correct offsets? Or does anyone have any thoughts on how to work around this?

I'm just submitting a question and not a bug because I know this is likely a strange use of this library.

Please help. Any and all help or ideas are very much appreciated!

Keywords

tooltip offsets editor iframe react portal

Metadata

Metadata

Labels

questionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions