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

[BUG] useScrollLock doesn't work in ios safari #508

Closed
jontewks opened this issue Feb 22, 2024 · 1 comment · Fixed by #509
Closed

[BUG] useScrollLock doesn't work in ios safari #508

jontewks opened this issue Feb 22, 2024 · 1 comment · Fixed by #509
Labels
bug Something isn't working

Comments

@jontewks
Copy link
Contributor

Describe the bug

In ios safari, using this hook with the default of document body doesn't actually prevent scrolling.

To Reproduce

Open the menu on your documentation site on an iPhone and see that when you scroll to the bottom, you can still scroll the body behind the menu.

Expected behavior

You should not be able to scroll the menu.

Additional context

This works if you set overflow: hidden; on ios rather than overflow-y. Unless there was a specific reason for that choice to only do Y when moving from useLockedBody, reverting to preventing all overflow seems to do the trick.

@jontewks jontewks added the bug Something isn't working label Feb 22, 2024
@jontewks
Copy link
Contributor Author

Opened a PR and tested using the menu open on ios safari in dev mode and confirmed the body was locked correctly in ios safari.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant