Skip to content

[Bug]: Adding empty td tag inside table throws RangeError #6237

Open
@its-me-dhina

Description

@its-me-dhina

Affected Packages

table

Version(s)

@tiptap/extension-table

Bug Description

const insert = <table><tr><td></td></tr></table>;

This is the content I am try to set into editor using

 editor?.chain()
        .focus()
        .insertContentAt(cursorPosition, content, {
          updateSelection: true,
          parseOptions: {
            preserveWhitespace: false,
          },
        })
        .run();

I am getting the following error.

Error inserting content: RangeError: Invalid content for node tableCell: <>

Dependencies

    "@tiptap/extension-table": "^2.6.6",
    "@tiptap/extension-table-cell": "^2.6.6",
    "@tiptap/extension-table-header": "^2.6.6",
    "@tiptap/extension-table-row": "^2.6.6",
    "@tiptap/react": "^2.6.6",
    "@tiptap/starter-kit": "^2.6.6",

Browser Used

Chrome

Code Example URL

No response

Expected Behavior

Should support the empty insertion

Additional Context (Optional)

No response

Dependency Updates

  • Yes, I've updated all my dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Category: Open SourceThe issue or pull reuqest is related to the open source packages of Tiptap.Type: BugThe issue or pullrequest is related to a bug

    Type

    No type

    Projects

    Status

    Needs Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions