[Bug]: NodePos querySelectorAll does not work for block nodes #4997
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.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?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: