[Bug]: NodePos is off by one for images #5314
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
core, image
Version(s)
2.4.0
Bug Description
I think this is a regression introduced by this PR: https://github.com/ueberdosis/tiptap/pull/5038/files
But basically, on an empty editor:
editor.$node('image').pos
and it will return1
editor.chain().setNodeSelection(1).run()
and it will select theafter it.
editor.chain().setNodeSelection(0).run()
will indeed select the image.For now I'm manually subtracting one, but it ain't pretty.
Browser Used
Chrome
Code Example URL
No response
Expected Behavior
I expect to be able to use nodepos to select images and do things with them (updateAttributes in my case)
Additional Context (Optional)
No response
Dependency Updates
The text was updated successfully, but these errors were encountered: