-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Bug: Insert Multiple Rows not working properly #6933
Copy link
Copy link
Closed
Labels
good first issueGood for newcomersGood for newcomerstablesRelates to Lexical TablesRelates to Lexical Tables
Description
Lexical version: 0.18.0
Steps To Reproduce
- Go to the lexical playground and insert a table
- 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] ); - 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomerstablesRelates to Lexical TablesRelates to Lexical Tables