Skip to content

[lexical-table] Bug Fix: prevent crash when moving selection with arrow key outside of nested table#8502

Merged
etrepum merged 1 commit into
facebook:mainfrom
randal-atticus:fix-arrow-escape-nested-table
May 13, 2026
Merged

[lexical-table] Bug Fix: prevent crash when moving selection with arrow key outside of nested table#8502
etrepum merged 1 commit into
facebook:mainfrom
randal-atticus:fix-arrow-escape-nested-table

Conversation

@randal-atticus

@randal-atticus randal-atticus commented May 12, 2026

Copy link
Copy Markdown
Contributor

Description

Closes #8484

Problem: With a table selection on a nested table, the arrow key handler would fire for both the parent and the nested table, and this breaks one of the invariants (LexicalTableObserver.$updateTableTableSelection).

The problem is similar in nature to the mouse selection bugs that were fixed by refactoring selection to be registered once, and handle all of the tables. Ideally we would do the same for the arrow key handler, but for now, this prevents the editor crash.

Test plan

Before

Insert relevant screenshots/recordings/automated-tests

After

Insert relevant screenshots/recordings/automated-tests

@vercel

vercel Bot commented May 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lexical Ready Ready Preview, Comment May 12, 2026 7:02am
lexical-playground Ready Ready Preview, Comment May 12, 2026 7:02am

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 12, 2026
@etrepum etrepum added the extended-tests Run extended e2e tests on a PR label May 12, 2026
@randal-atticus randal-atticus marked this pull request as ready for review May 12, 2026 23:41
@etrepum

etrepum commented May 13, 2026

Copy link
Copy Markdown
Collaborator

I'm going to go ahead and merge this even without tests since we don't really have actual support for nested tables yet and it's clearly an improvement

@etrepum etrepum added this pull request to the merge queue May 13, 2026
Merged via the queue into facebook:main with commit 84ed5b6 May 13, 2026
45 checks passed
@etrepum etrepum mentioned this pull request May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. extended-tests Run extended e2e tests on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Selection a TableRow outside the nested table breaks the editor

3 participants