Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: NodePos is off by one for images #5314

Open
1 task done
masylum opened this issue Jul 4, 2024 · 0 comments
Open
1 task done

[Bug]: NodePos is off by one for images #5314

masylum opened this issue Jul 4, 2024 · 0 comments
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

Comments

@masylum
Copy link

masylum commented Jul 4, 2024

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:

  • add an Image
  • run editor.$node('image').pos and it will return 1
  • run editor.chain().setNodeSelection(1).run() and it will select the

    after it.

  • run 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

  • Yes, I've updated all my dependencies.
@masylum masylum added 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 labels Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
Status: Triage open
Development

No branches or pull requests

1 participant