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][lexical-playground] Bug Fix: Table selection stuck #6049

Merged

Conversation

AlexanderReznik
Copy link
Contributor

Description

Prevents table selection from being stuck.
The problem is wrong order of handling the mouse events. mouseup can happen before mousedown handler added a handler for mouseup. This leaves the editor in a state of selecting.
This PR adds clean up logic into mousemove to prevent selection being stuck

The modification of dragMouse is required for tests to pass, as it seems that this bug contributed to the successful execution of some test

Before

table-selection-stuck

Copy link

vercel bot commented May 7, 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 May 8, 2024 9:18am
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 8, 2024 9:18am

@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 May 7, 2024
@ivailop7
Copy link
Collaborator

ivailop7 commented May 7, 2024

@AlexanderReznik on manually testing, it does work in Safari on a Mac as well, but the issue seems to be indeed a test thing with WebKit, since it consistently fails on the same DraggableBlock, it's possible it's indeed a correct failure. Maybe worth taking inspiration from the DraggableBlock tests to implement the ones here.

Copy link
Collaborator

@ivailop7 ivailop7 left a comment

Choose a reason for hiding this comment

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

LGTM

@ivailop7 ivailop7 merged commit 7e3a79c into facebook:main May 8, 2024
45 checks passed
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants