[Modal] `blockScrollOnMount` fails on iOS devices
See original GitHub issueDescribe the bug
blockScrollOnMount
fails on iOS devices. Scrolling the background remains, and the following error appears in the console:
disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.
See https://github.com/willmcpo/body-scroll-lock/blob/master/src/bodyScrollLock.js#L148
Expected Behavior Scrolling should stop.
To Reproduce
- Use an iOS device
- Go to https://chakra-ui.com/modal#block-scrolling-when-modal-opens
- Click on any modal (by default, they all have
blockScrollOnMount = true
) - Scroll the page
Desktop (please complete the following information):
- OS: iOS
- Browser: Safari
- Version: Tested on both 13.4.1 and 11
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:24 (6 by maintainers)
Top Results From Across the Web
Close Button on Modal disappear in real iphone
When click into image, the image gallery will appear but in iphone, it just have previous button and next button, the close button...
Read more >failed to prepare device for deplo… | Apple Developer Forums
I have tried running an app I've been working on on my phone and I keep getting a "Failed to prepare this device...
Read more >Modal - Chakra UI
A modal is a dialog that focuses the user's attention exclusively on an information via a window that is overlaid on primary content....
Read more >Troubleshooting Duo Push notification issues on iOS devices
Fully close Duo Mobile by either swiping up on the screen or double-tapping the home button and then swiping up on the screen...
Read more >iOS Simulator - Expo Documentation
This is sometimes useful for cases where your computer is low on memory and the simulator fails to store some internal file, leaving...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m getting this error logged to the console for me as well, but not even using an ios device, just using firefox or chrome on a mac.
I found I could prevent the errors from logging to the console, by locking to a previous body-scroll-lock version using resolutions in my package.json file.
Note: looking through the code, it appears they dropped body-scroll-lock and replaced it with react-remove-scroll in v1.
I can confirm I’m also seeing this issue on OSX, tested in both safari and chrome, has this been updated already?