Scrolling interacts strangely with SafeAreaView on iPhone X
See original GitHub issueIs this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
(Expo) Packages: (wanted => installed) react: 16.0.0 => 16.0.0 react-native: https://github.com/expo/react-native/archive/sdk-23.0.0.tar.gz => 0.50.3
Steps to Reproduce
- Put a
SafeAreaView
around content inside of aScrollView
. - Make sure there is plenty of content to scroll through.
- Run the app on an iPhone X or in the iPhone X Simulator.
Expected Behavior
Scrolling should behave as normally, with the SafeAreaView
in effect when the scroll position is at the beginning and end of the content.
Actual Behavior
Scrolling is difficult, and often results in janky behavior. The more complex and long the content, the worse it is.
Here’s a gif of the behavior:
Note how the content continuously changes position, even when not scrolling.
Reproducible Demo
https://snack.expo.io/rkiomUcgz
Make sure to use an iPhone X device, or download and open in XDE to install it on the iPhone X Simulator.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:24
- Comments:25 (7 by maintainers)
Top Results From Across the Web
Safari on iPhone X scrolling is VE… | Apple Developer Forums
Safari on iPhone X scrolling is VERY choppy and laggy ... The scrolling of choosing which tab to go to in the tab...
Read more >ScrollView - React Native
iOS. . When true, the scroll view bounces vertically when it reaches the end even if the content is smaller than the scroll...
Read more >[Solved]-The SafeAreaView causes weird gap on screen
The issue might be with the conflicting SafeAreaView in the Navigation component. You can skip the bottom padding for the SafeArea like this,...
Read more >Last view added to content view of scrollview goes behind the ...
Scroll view subclasses like table view and collection view handles this problem automatically if you pin the bottom anchor to safe area. Since ......
Read more >Supporting safe areas | React Navigation
Notch on the iPhone X. While React Native exports a SafeAreaView component, it has some inherent issues, i.e. if a screen containing safe...
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 had the same situation, and contentInsetAdjustmentBehavior worked for me
from react-native repo, ScrollView code says:
I am on react-native 0.59.9 and when I set
contentInsetAdjustmentBehavior="automatic"
onScrollView
,FlatList
orSectionList
, the padding is correctly added at the bottom and the content is allowed to scroll beneath the bottom part where the “home button” is. There is no need to use aSafeAreaView
to achieve this.