Skip to content

[lexical-table] Bug Fix: Prevent single-cell table selection after exiting table selection#8195

Merged
etrepum merged 3 commits intofacebook:mainfrom
randal-atticus:fix-table-highlight-stickiness
Mar 9, 2026
Merged

[lexical-table] Bug Fix: Prevent single-cell table selection after exiting table selection#8195
etrepum merged 3 commits intofacebook:mainfrom
randal-atticus:fix-table-highlight-stickiness

Conversation

@randal-atticus
Copy link
Contributor

@randal-atticus randal-atticus commented Mar 6, 2026

Description

Bug introduced in #8193, I think. We were not calling $clearHighlight of a table when clicking on it, meaning it stayed in "highlight mode". This made the table selection mode feel sticky, because any subsequent pointerMove events (which are very eager to fire) would highlight the entire cell. The only way to exit the mode was to very precisely click without moving the mouse.

Test plan

Before

Screen.Recording.2026-03-06.at.9.00.56.pm.mov

After

Screen.Recording.2026-03-06.at.9.01.12.pm.mov

@vercel
Copy link

vercel bot commented Mar 6, 2026

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

Project Deployment Actions Updated (UTC)
lexical Ready Ready Preview, Comment Mar 9, 2026 0:56am
lexical-playground Ready Ready Preview, Comment Mar 9, 2026 0:56am

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 Mar 6, 2026
focusCell !== tableObserver.anchorCell &&
tableObserver.anchorCell !== null &&
tableObserver.anchorCellNodeKey !== null &&
focusCell.elem !== tableObserver.anchorCell.elem &&
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also had to change this because even when they were the same cell, they were not referentially equal

etrepum
etrepum previously approved these changes Mar 6, 2026
Copy link
Collaborator

@etrepum etrepum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved assuming tests are passing

@etrepum etrepum dismissed their stale review March 6, 2026 17:00

Looks like there might be some kind of issue with collab here

@etrepum
Copy link
Collaborator

etrepum commented Mar 6, 2026

Looks like there's some sort of conflict with collab in this PR that needs further investigation

@randal-atticus
Copy link
Contributor Author

Seems to have just been an issue in one test, even though other tests failed. Fixed.

@etrepum etrepum added this pull request to the merge queue Mar 9, 2026
Merged via the queue into facebook:main with commit fb6bf59 Mar 9, 2026
37 checks passed
@etrepum etrepum mentioned this pull request Mar 19, 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.

2 participants