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

Add setTimeout for mousemove handler #5919

Merged
merged 2 commits into from
Apr 19, 2024

Conversation

AlexanderReznik
Copy link
Contributor

@AlexanderReznik AlexanderReznik commented Apr 18, 2024

Fixes
table-selection-scroll
Selection is getting stuck and the page is not getting scrolled automatically

Happens in Chrome, not in Firefox
The problem is that the order of events mousemove and selectionchange is not deterministic. When mousemove is handled before it prevents selectionchange handler from executing fully resulting in this bug.

Copy link

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

@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 Apr 18, 2024
ivailop7
ivailop7 previously approved these changes Apr 18, 2024
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

@StyleT
Copy link
Contributor

StyleT commented Apr 18, 2024

Hi! Thanks for the PR! Do you think it's possible to add test here to prevent future regression?

@AlexanderReznik
Copy link
Contributor Author

Do you think it's possible to add test here to prevent future regression?

I've tried, couldn't add a test for the mouse leaving the window to cause a scroll

@StyleT
Copy link
Contributor

StyleT commented Apr 18, 2024

Do you think it's possible to add test here to prevent future regression?

I've tried, couldn't add a test for the mouse leaving the window to cause a scroll

No worries, can you pls then add a code comment to explain setTimeout presence and TODO with newly created issue number that shall address lack of test here. So someone else (maybe me), can take a look at the test.

I'll merge it right after you have comment + follow up issue to write test.

zurfyx
zurfyx previously approved these changes Apr 18, 2024
@AlexanderReznik
Copy link
Contributor Author

No worries, can you pls then add a code comment to explain setTimeout presence and TODO with newly created issue number that shall address lack of test here. So someone else (maybe me), can take a look at the test.

#5928
c626b1b

@ivailop7 ivailop7 merged commit 78bac6c into facebook:main Apr 19, 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.

None yet

5 participants