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.

Scrolling on iOS is blocked even when blocking is set to false

See original GitHub issue

If you open the BottomSheet it will block any scrolling containers on iOS even if the BottomSheet is configured as false. Example link: https://react-spring-blocking-ios-scroll.vercel.app/ Example code:

import { useState } from 'react';
import { BottomSheet } from 'react-spring-bottom-sheet';
import 'react-spring-bottom-sheet/dist/style.css';

export default function Home() {
	const [open, setOpen] = useState(false);
	return (
		<>
			<button onClick={() => setOpen(true)}>Open</button>
			<div style={{ border: '3px solid red', overflowY: 'scroll', height: '100px' }}>
				<div>1</div>
				<div>2</div>
				<div>3</div>
				<div>4</div>
				<div>5</div>
				<div>1</div>
				<div>1</div>
				<div>1</div>
				<div>1</div>
				<div>1</div>
				<div>1</div>
				<div>1</div>
				<div>1</div>
				<div>1</div>
				<div>1</div>
				<div>1</div>
				<div>1</div>
				<div>1</div>
				<div>1</div>
				<div>1</div>
				<div>1</div>
				<div>1</div>
				<div>1</div>
				<div>1</div>
				<div>1</div>
				<div>1</div>
				<div>1</div>
				<div>1</div>
			</div>
			<BottomSheet open={open} blocking={false}>
				<div>Bottom Sheet Content</div>
				<div>Bottom Sheet Content</div>
				<div>Bottom Sheet Content</div>
				<div>Bottom Sheet Content</div>
				<div>Bottom Sheet Content</div>
				<div>Bottom Sheet Content</div>
				<div>Bottom Sheet Content</div>
				<div>Bottom Sheet Content</div>
			</BottomSheet>
		</>
	);
}

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
spencersteerscommented, Jan 9, 2021

Ran into this too. Adding data-body-scroll-lock-ignore="true" will fix it.

0reactions
leecrossleycommented, Feb 1, 2022

There are potentially some improvements that can be made here, some ideas:

  • checking to see if the body content is scrollable, a lot of modern web / hybrid apps don’t have a scrollable body and this default will have some devs tearing their hair out for a couple of hours (cough) or:
  • snapPoints all greater than 0, then ignore?
  • -webkit-fill-available might be worth a look?
  • 1px bottom hack?

Thanks for a great lib 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Blocking feature not working - Apple Support Communities
Go to the conversation thread in the Messages app of the contact you'd like to block and tap on the contact's name. ·...
Read more >
Simple Solution to Prevent Body Scrolling on iOS
The most straightforward way for disabling scrolling on websites is to add overflow: hidden on the <body> tag. Depending on the situation, this ......
Read more >
Issue in blocking Vertical scroll on UIScrollView in Swift 4.0
Save this question. Show activity on this post. and once I block the vertical scroll, this function to scrollReactToVisible doesn't do anything.
Read more >
overflow-x - CSS: Cascading Style Sheets - MDN Web Docs
This may be nothing, a scroll bar, or the overflow content. ... overflow-x CSS property sets what shows when content overflows a block-level ......
Read more >
How To Prevent Scrolling The Page On iOS Safari 15 - PQINA
On iOS 100vh is always the full height of the viewport, even if the footer ... want to block all overflowing content */...
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