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

iOS Devices: "restorePositionSetting" can run before "setPositionFixed" #247

Open
dafcoe opened this issue Feb 8, 2022 · 0 comments
Open

Comments

@dafcoe
Copy link

dafcoe commented Feb 8, 2022

In some situations it can happen that "restorePositionSetting" runs before "setPositionFixed" when calling "enableBodyScroll" right after "enableBodyScroll" and therefore the scroll lock is not being released due to fixed positioning on target element.

Example: https://codesandbox.io/s/wizardly-sound-53xgy

Possible fix: by wrapping restorePositionSetting logic on a requestAnimationFrame method queues the execution and prevent this issue to happen since setPositionFixed is already using requestAnimationFrame. Created a pull request with this change.

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

1 participant