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.

ScrollView bounce stuck mid-animation when scrolling inertially on Android

See original GitHub issue

Description

When you scroll in a ScrollView and it reaches its end, it will leave a small gap below the ScrollView (note the white space above the Android navigation bar). I think it’s because the bounce animation gets cut off. It only happens when you scroll inertially - if you reach the end with your finger still on the screen, it works as expected.

screenshot_2016-10-31-12-22-22

The size of the gap depends on how much inertia you give it:

screenshot_2016-10-31-12-22-31

When you then interact with screen again (try to overscroll), the gap disappears:

screenshot_2016-10-31-12-22-40

I also tried giving the ScrollView flex: 1, wrapping it in a View with flex: 1, disabling removeClippedSubviews - all the “tricks” I could find in other issues, but still no go.

I expect the ScrollView to have the same bounce effect at its start and its end and to not leave any gaps behind.

What’s actually happening is that the ScrollView bounce effect only works at the top. At the bottom, it gets chopped off and leaves a gap behind.

Reproduction

I couldn’t reproduce it on rnplay, but I see it on all my devices (Android 5 & 6) and also in Genymotion VMs (Android 4 & 6). Here is a sample project:

$ git clone https://github.com/stovmascript/sample-react-native-scrollview-issue.git

Of course, it’s also reproducible on ListViews, where I initially noticed it.

Additional Information

  • React Native version: 0.36.0
  • Platform: Android
  • Operating System: MacOS

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
stovmascriptcommented, Oct 31, 2016

@brentvatne Looks like there was a change to the ScrollView here:

Fix ScrollView bounce back bug in open source (36ca1a0) - @astreet

There are other commits since then, but some have been reverted, so this might be it?

0reactions
astreetcommented, Nov 2, 2016

Thanks for the bug report! This should be fixed now in https://github.com/facebook/react-native/commit/f2d3113c1db894097ef67ab1da84a508e39a3448 (I verified it no longer repros with your sample app – thanks for providing it!)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Animated.ScrollView is not scrolling horizontally, only on ...
I created to scroll multi-pages using Animated.ScrollView. It is working properly on iOS, but it got stuck on Android.
Read more >
Common bugs in React Native ScrollView and how to fix them
React Native's ScrollView component is ubiquitous, but its implementation can sometimes lead to mistakes. Learn what to look out for here.
Read more >
How to stop Scrollview Inertial scrolling and response ... - MSDN
Is there a way I can have the Inertia animation, but when I scroll other direction, it can response immediately? Thanks & regards,....
Read more >
How UIScrollView works - Medium
Now let's look at how bounce will work and how the transition from deceleration to spring animation will be implemented: define the bound...
Read more >
UIScrollView's Inertia, Bouncing and Rubber-Banding with ...
We're now ready to add an inertial scrolling. There are two things to it: 1) when a user lifts a finger off the...
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