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

Fix scrolling issues due to browser rounding bugs #2350

Merged
merged 1 commit into from
Jun 6, 2022
Merged

Conversation

trueadm
Copy link
Collaborator

@trueadm trueadm commented Jun 6, 2022

After digging into https://bugzilla.mozilla.org/show_bug.cgi?id=1768330, I was able to reproduce the issue using Firefox on Windows. I couldn't get it working with Firefox on macOS. When you zoom in, and do getBoundingClientRect, you get back decimal numbers, and strangely, doing it of two elements that are the same size, can return slightly different values. One being 123.21 pxiels and the other being 123.22 pixels, which then causes the logic to incorrectly scroll.

@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 Jun 6, 2022
@vercel
Copy link

vercel bot commented Jun 6, 2022

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

Name Status Preview Updated
lexical ✅ Ready (Inspect) Visit Preview Jun 6, 2022 at 3:31PM (UTC)
lexical-playground ✅ Ready (Inspect) Visit Preview Jun 6, 2022 at 3:31PM (UTC)

Copy link
Contributor

@tylerjbainbridge tylerjbainbridge left a comment

Choose a reason for hiding this comment

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

Huge!! Nice job catching this.

@trueadm trueadm merged commit 1d43769 into main Jun 6, 2022
@trueadm trueadm deleted the fix-scroll branch June 6, 2022 16:01
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