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

Return pos if descObj.parent is null #117

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Feb 3, 2022

  1. Return pos if descObj.parent is null

    In the example at https://tiptap.dev/api/nodes/task-item if you try to click the checkbox to toggle the todo item, you get a console error message:
    ```
    Uncaught RangeError: Index 1 out of range for <taskList(taskItem(paragraph("A list item")), taskItem(paragraph("And another one")))>
        at F.child (vendor.248662a3.js:5:26763)
        at F.findIndex (vendor.248662a3.js:5:27448)
        at Me.nodeAt (vendor.248662a3.js:5:40931)
        at index.8f971c3d.js:1:2515
        at tabindex.0101c1e1.js:3:1741
        at Object.command (tabindex.0101c1e1.js:3:24344)
        at HTMLInputElement.<anonymous> (index.8f971c3d.js:1:2476)
    ```
    
    Looking into this, it looks like descObj exists, but descObj.parent is null, so the function returns nothing. When I changed the return value to `pos`, it started working again.
    egwoo authored Feb 3, 2022
    Configuration menu
    Copy the full SHA
    926fe1a View commit details
    Browse the repository at this point in the history