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 querySelectorAll does not work for block nodes #4997

Closed
1 of 2 tasks
QuinnStraus opened this issue Mar 20, 2024 · 0 comments · Fixed by #5038
Closed
1 of 2 tasks

[Bug]: NodePos querySelectorAll does not work for block nodes #4997

QuinnStraus opened this issue Mar 20, 2024 · 0 comments · Fixed by #5038
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

@QuinnStraus
Copy link

QuinnStraus commented Mar 20, 2024

Which packages did you experience the bug in?

core

What Tiptap version are you using?

2.2.4

What’s the bug you are facing?

Calling the querySelector or querySelectorAll methods on the nodePos that references a block node will always return an empty array. This is caused by an explicit early return statement in the code.

I cannot figure out why this would be desired, and ruins a lot of the usefulness of this feature for me. This also breaks the second example on the "What can I do with NodePos" section in the documentation.

What browser are you using?

Chrome

Code example

https://codesandbox.io/p/sandbox/gracious-pond-tvws43

What did you expect to happen?

I expect $listItems to be a list of 3 NodePos for each list item (as the documentation would suggest), but this is not the case.

Anything to add? (optional)

No response

Did you update your dependencies?

  • Yes, I’ve updated my dependencies to use the latest version of all packages.

Are you sponsoring us?

  • Yes, I’m a sponsor. 💖
@QuinnStraus QuinnStraus 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 Mar 20, 2024
@github-project-automation github-project-automation bot moved this to Triage open in Tiptap Mar 20, 2024
@github-project-automation github-project-automation bot moved this from Triage open to Done in Tiptap Apr 9, 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: Done
Development

Successfully merging a pull request may close this issue.

1 participant