software-mansion / react-native-gesture-handler

Declarative API exposing platform native touch and gesture system to React Native.
https://docs.swmansion.com/react-native-gesture-handler/
MIT License
6.12k stars 979 forks source link

ScrollView reverse auto scrolling on Android with spring animation on parent view #1328

Closed aravikanti closed 2 years ago

aravikanti commented 3 years ago

Description

I have an Animated View with a header view on top and ScrollView on bottom. I implemented a snapping animation where when we pan from bottom to top it snaps to bottom and reveals ScrollView completely. When I pan from top to bottom it snaps back to header view with focus on top.

When I pan quickly from top to bottom on scroll view I am seeing on Android that the scroll view auto scrolls in opposite direction. It is as if the pan velocity directly transfers to scroll view in opposite direction.

This issue is also happening on: https://github.com/software-mansion/react-native-gesture-handler/blob/master/examples/Example/bottomSheet/index.js this as well.

Screenshots

Steps To Reproduce

  1. Open https://snack.expo.io/DOnNYqdCl on your android phone
  2. Scroll from bottom to top to snap to scroll view
  3. Scroll quickly from bottom to top and see that scroll view auto scrolls in opposite direction.

Expected behavior

Scroll View should not auto scroll on pan gesture.

Actual behavior

Scroll view auto scrolls quickly in opposite direction.

Snack or minimal code example

I have the code here: https://snack.expo.io/DOnNYqdCl (Hope it is readable) which is somewhat similar to https://github.com/software-mansion/react-native-gesture-handler/blob/master/examples/Example/bottomSheet/index.js but implemented with react-native-reanimated.

Package versions

j-piasecki commented 2 years ago

Hi! If this is still affecting you, could you try upgrading Gesture Handler and Reanimated to the latest versions to see if it solves the problem? I tried your snack, but unfortunately version 40 of Expo SDK is no longer supported by Expo Go and upgrading it gives me a blank screen.