jeremybarbet/react-native-modalize

Problem with panGestureAnimatedValue

bintoll opened this issue · 2 comments

Describe the bug
The problem with panGestureAnimatedValue is that it is not working as expected (as describet) - the animated value changes not just according modal position between 0 and 1 when modal is opened and closed. But it actually changes when there is a Pan gesture (is some circumstances), but in this case the truly animated value that could be described like: "Animated.Value of the modal opening position between 0 and 1." (from the docs) is missing.
I have setup Modalize with flat list props and added panGestureAnimatedValue prop. When modal change state from close to open and backwards it works fine. But if I open the modal and scroll down the flat list and then scroll the the flat list a little bit up the Pan gesture activates and changes panGestureAnimatedValue value, even through the modal is still opened. Looks like the exact same issue was described here #350

Reproduce

Dependencies:

  • react-native-modalize 2.1.1
  • react-native 0.70.6
  • react-native-gesture-handler 2.8.0
  • expo/react-navigation/react-native-navigation: react-navigation@6.1.1

After some source code investigation, I found out that code in these handle is causing the problem:

const handleGestureEvent = Animated.event([{ nativeEvent: { translationY: dragY } }], {

I have the same issue. Is there any update here?