[Bug]: React node views unexpectedly move state between nodes #5927
Labels
Category: Open Source
The issue or pull reuqest is related to the open source packages of Tiptap.
Type: Bug
The issue or pullrequest is related to a bug
Affected Packages
react, bubble-menu, extension-collaboration, extension-placeholder
Version(s)
2.10.2
Bug Description
Hello! My team has been experiencing some very strange behaviour while using a custom React node view in combination with
collaboration
,placeholder
and ReactBubbleMenu
.When the editor initially loads, it's possible for the internal React state of a node view to "move" to a preceding node. It seems there is some strange reconciliation behaviour happening with the decorations applied by placeholder as well as the registration of the
BubbleMenu
plugin when the views are surrounded by empty paragraph nodes.To reproduce:
4
2
CleanShot.2024-12-11.at.14.19.49.mp4
This does not occur if:
BubbleMenu
is registered as soon as possible*Collaboration
orPlaceholder
is removed*We are running TipTap in production and the only surefire way to resolve this has been to remove
Placeholder
, even when using the menu.Browser Used
Chrome
Code Example URL
https://github.com/andy-hook/tiptap-node-view-state-repro
Expected Behavior
Every node view retains it's state while interacting with the editor
Additional Context (Optional)
No response
Dependency Updates
The text was updated successfully, but these errors were encountered: