-
Notifications
You must be signed in to change notification settings - Fork 337
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
When enabled, scrolls to top of document in iOS Safari on Version: 4.0.0-beta.0 #237
Comments
I can confirm this |
Same here on iOS 15.0.2. // When disabling body scrolling
const storedScrollY = window.scrollY;
disableBodyScroll(el);
document.body.style.setProperty("top", `${window.scrollY * -1}px`);
// Enabling body scrolling
enableBodyScroll(el);
document.body.style.setProperty("top", "");
document.body.scrollTo(0, storedScrollY); 4.0.0-beta.0 is currently the version pulled from npm when no version is specified, so more people might come back with this issue. |
Confirming and following to see when there is a fix, for now I'll roll back. |
Ran into exactly this same problem today! @Basics09 thanks for the quick hack. Hope this gets resolved soon |
@willmcpo Not sure if cause of error, but the highlighted line 130 should probably be Edit: very certain this is the bug now. Here's a hack that doesn't result in the blacked out region, which I still get with @Basics09's solution. Also oops, original sets style before calculating height, so I don't think bottom bar detection works with this approach though might still be preferable for some people. // Disabling scroll works with temporary overwrite
const storedRequestAnimationFrame = window.requestAnimationFrame;
window.requestAnimationFrame = () => 42;
disableBodyScroll(element);
window.requestAnimationFrame = storedRequestAnimationFrame;
// Enabling scroll stays the same
enableBodyScroll(element); If you're using React hooks use |
Any update here? |
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
repair log,Refer to the releases page. |
Version: 4.0.0-beta.0
Adds
position: fixed
to body on iOS, which causes the document to scroll to the top. This did not occur on previous version (v3.1.5).The text was updated successfully, but these errors were encountered: