fix: add data attribute for correct react rendering #1954
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This was caused by a change to Tiptap in a more recent version: ueberdosis/tiptap#6600 which specifically looks for an attribute which Tiptap expects on an element to exist to be considered as part of the contentDOM.
BlockNote does not use the
NodeViewContent
React component (instead using the BlockNotecontentRef
). So, to address this issue, we now explicitly set the data-attribute which Tiptap's React integration expects on the element.This element is handed off to ProseMirror anyway so React should not blow it away on render.
While we are at it, updated all
@tiptap/*
packages to their latest versions. These are likely the last versions before we switch to v3. We may want to consider always pulling the latest tiptap versions to catch these sorts of issues soonerFixes #1844
Fixes #1897
Resolves Linear Ticket: https://linear.app/blocknote/issue/BLO-301/react-blocks-broken-tiptap-2250