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

[lexical-table] Bug Fix: Fix crash in $deleteCellHandler #6650

Merged
merged 4 commits into from
Sep 20, 2024

Conversation

etrepum
Copy link
Collaborator

@etrepum etrepum commented Sep 19, 2024

Description

In certain situations $deleteCellHandler will remove a table without fixing up the selection and also return false, which turns into a crash in the editor's command listener because the selection's anchor or focus is no longer connected to the root.

Closes #6581

Test plan

Before

  1. Create a table
  2. Remove the paragraph before the table
  3. Select all from inside the table (anchor will be inside the table, focus will be outside the table)
  4. Press delete
  5. Crash

After

No crash

Copy link

vercel bot commented Sep 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 20, 2024 3:08am
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 20, 2024 3:08am

@facebook-github-bot facebook-github-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 Sep 19, 2024
Copy link

github-actions bot commented Sep 19, 2024

size-limit report 📦

Path Size
lexical - cjs 29.85 KB (0%)
lexical - esm 29.66 KB (0%)
@lexical/rich-text - cjs 38.3 KB (0%)
@lexical/rich-text - esm 31.55 KB (0%)
@lexical/plain-text - cjs 36.9 KB (0%)
@lexical/plain-text - esm 28.86 KB (0%)
@lexical/react - cjs 40.04 KB (0%)
@lexical/react - esm 32.91 KB (0%)

@etrepum etrepum changed the title [lexical-table] Bug Fix: Fix crash in $deleteCellHandler [lexical-table][lexical-code] Bug Fix: Fix crash in $deleteCellHandler Sep 19, 2024
@etrepum etrepum changed the title [lexical-table][lexical-code] Bug Fix: Fix crash in $deleteCellHandler [lexical-table] Bug Fix: Fix crash in $deleteCellHandler Sep 19, 2024
@etrepum etrepum marked this pull request as ready for review September 20, 2024 00:07
@potatowagon potatowagon added this pull request to the merge queue Sep 20, 2024
Merged via the queue into facebook:main with commit cf43676 Sep 20, 2024
38 checks passed
@ivailop7
Copy link
Collaborator

Thank you for your help on this one!

@etrepum etrepum deleted the deleteCellHandler-fix branch September 20, 2024 18:42
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: Crash when select all and delete with only table in the editor
4 participants