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

The content is twitching 15px from the right on MacOS Safari #251

Open
TangoPJ opened this issue Apr 9, 2022 · 3 comments
Open

The content is twitching 15px from the right on MacOS Safari #251

TangoPJ opened this issue Apr 9, 2022 · 3 comments

Comments

@TangoPJ
Copy link

TangoPJ commented Apr 9, 2022

How can I solve my problem, I'm using the package in my Nuxt.js project, in the chrome browser it works without problems, but when I open localhost in the Safari - the content is twitching 15px from the right?

@kosmeln
Copy link

kosmeln commented Jun 11, 2022

We got the same issue. For me it happens when you have an external mouse connected - MacOS reserves a width for the scroll bar. When you turn off/disconnect the mouse - that width will be released, giving this space back to the page. Scrolling with a Touch Bar trigger the overlay scrollbar that overlaps the page - don't shift it.
What happens when we trigger the scroll lock - it that reserved width is released in some way, causing the page to visually shift.

@alexd3d
Copy link

alexd3d commented Oct 17, 2022

Hey guys, @TangoPJ @kosmeln
just had the same issue with new 4.0.0-beta. Plugin devs are setting left:0 top: 0 for body on iOS if it's locked , but seems like Safari does not always properly thinks that the width should be 100%. On tablet landscape instead of 1130 width I got only 930px size body container - so the right gap increases with viewport size. So in this case you just need to set for body "width: 100%" OR "right: 0" - it would force Safari to set body to full-width size as it should be. This can be set in general CSS file because I don't see scenario where this CSS rule break something else (I hope :) ).

@rick-liruixin
Copy link

Hey guys, @TangoPJ @kosmeln just had the same issue with new 4.0.0-beta. Plugin devs are setting left:0 top: 0 for body on iOS if it's locked , but seems like Safari does not always properly thinks that the width should be 100%. On tablet landscape instead of 1130 width I got only 930px size body container - so the right gap increases with viewport size. So in this case you just need to set for body "width: 100%" OR "right: 0" - it would force Safari to set body to full-width size as it should be. This can be set in general CSS file because I don't see scenario where this CSS rule break something else (I hope :) ).

They stopped the repairs. I had to do it myself, in the same way, with a new version of typeScript. And fix these problems for everyone to use. add react hooks、vue3 example

npm i body-scroll-lock-upgrade

repair log,Refer to the releases page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants