[Bug]: NodePos depth is not set correctly #5117
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
Which packages did you experience the bug in?
core
What Tiptap version are you using?
2.3.1
What’s the bug you are facing?
The depth of the NodePos is not set correctly. You can see it in the below snippet:
tiptap/packages/core/src/NodePos.ts
Lines 133 to 155 in 2b24986
In line 149, the
actualDepth
of thechildNodePos
is set correctly. However, in line 152, thechildNodePos
is not pushed to thechildren
array. Instead, a brand new NodePos instance is created. As a result, theactualDepth
is never set.Simply, replacing line 152 with
children.push(childNodePos)
will solve the issue.What browser are you using?
Chrome
Code example
No response
What did you expect to happen?
The depth of the NodePos is set correctly.
Anything to add? (optional)
No response
Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: