Skip to content

Bug: Insert Multiple Rows not working properly #6933

@ritikaGupta4

Description

@ritikaGupta4

Lexical version: 0.18.0

Steps To Reproduce

  1. Go to the lexical playground and insert a table
  2. If you try to add multiple rows, only 1 row is added.
    Update your function insertTableRowAtSelection:
    const insertTableRowAtSelection = useCallback( (shouldInsertAfter) => { editor.update(() => { for (let i = 0; i < selectionCounts.rows; i += 1) { $insertTableRowExperimental(shouldInsertAfter); } onClose(); }); }, [editor, onClose, selectionCounts.rows] );
  3. After updating multiple rows insertion works, but Insert x rows below does not work properly, it adds rows in-between selected rows
Screen.Recording.2024-12-10.at.12.41.16.PM.mov

Link to code example:
const insertTableRowAtSelection = useCallback( (shouldInsertAfter) => { editor.update(() => { for (let i = 0; i < selectionCounts.rows; i += 1) { $insertTableRowExperimental(shouldInsertAfter); } onClose(); }); }, [editor, onClose, selectionCounts.rows] );

The current behavior: Insert Multiple Rows not working properly

The expected behavior: Please fix Multiple Rows Insertion

Impact of fix

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions