question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Modal] `blockScrollOnMount` fails on iOS devices

See original GitHub issue

Describe 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

  1. Use an iOS device
  2. Go to https://chakra-ui.com/modal#block-scrolling-when-modal-opens
  3. Click on any modal (by default, they all have blockScrollOnMount = true)
  4. 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:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:24 (6 by maintainers)

github_iconTop GitHub Comments

13reactions
dustycommented, Oct 23, 2020

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.

"resolutions": {
    "body-scroll-lock": "3.0.3"
  },

Note: looking through the code, it appears they dropped body-scroll-lock and replaced it with react-remove-scroll in v1.

6reactions
gaurangrshahcommented, Sep 18, 2020

I can confirm I’m also seeing this issue on OSX, tested in both safari and chrome, has this been updated already?

image

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found