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

Bug: An error occurs when navigating a table with merged cells using the arrow keys(keyboard). #6515

Closed
kmslab20 opened this issue Aug 13, 2024 · 0 comments · Fixed by #6529

Comments

@kmslab20
Copy link
Contributor

kmslab20 commented Aug 13, 2024

Lexical version: 0.17.0
OS: Windows 11
Browser: Chrome latest (127.0.6533.100)

Steps To Reproduce

  1. Visit playground
  2. Remove all contents, and insert a table (I picked 5x5, any size is OK)
  3. Merge some cells.
  4. Navigate the cells using the down arrow key, from right side or inside the merged cell.
2024-08-13.11-07-18.mp4
2024-08-13.11-08-49.mp4
2024-08-13.17-00-50.mp4

The current behavior

When I navigate the table with merged cells, this error occurs in some cases:

Uncaught Error: Node at cords not TableCellNode.
    at rs.getCellNodeFromCordsOrThrow (main-CUjk_Nh6.js:59:32769)
    at sS (main-CUjk_Nh6.js:59:25177)
    at xc (main-CUjk_Nh6.js:59:28983)
    at Array.<anonymous> (main-CUjk_Nh6.js:59:17723)
    at Yx (main-CUjk_Nh6.js:51:24287)
    at main-CUjk_Nh6.js:51:24077
    at Jx (main-CUjk_Nh6.js:51:25451)
    at Gn (main-CUjk_Nh6.js:51:26422)
    at yg.update (main-CUjk_Nh6.js:51:43947)
    at Yx (main-CUjk_Nh6.js:51:24063)

I tried this in my React app, and the error message was like this:

Uncaught Error: Node at cords not TableCellNode.
    at TableNode.getCellNodeFromCordsOrThrow (LexicalTable.dev.mjs:2710:13)
    at selectTableNodeInDirection (LexicalTable.dev.mjs:2189:39)
    at $handleArrowKey (LexicalTable.dev.mjs:2420:16)
    at Array.<anonymous> (LexicalTable.dev.mjs:1669:95)
    at triggerCommandListeners (Lexical.dev.mjs:8113:27)
    at Lexical.dev.mjs:8097:19
    at $beginUpdate (Lexical.dev.mjs:8230:5)
    at updateEditor (Lexical.dev.mjs:8306:5)
    at LexicalEditor.update (Lexical.dev.mjs:9961:5)
    at triggerCommandListeners (Lexical.dev.mjs:8096:12)

After the error occurs, the lexical editor no longer works properly.

The expected behavior

When the down arrow key is pressed, the pointer should move to the cell directly below in the same column.

Impact of fix

Fixing this bug would improve table features, benefiting many users who use table and cell-merging features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant