react-native-gesture-handler icon indicating copy to clipboard operation
react-native-gesture-handler copied to clipboard

Pan gesture with manual activation disables responding of any touchable in the app

Open antonkarytski opened this issue 1 year ago • 0 comments

Description

When using Pan gestures (this issue likely occurs with other gestures as well, but has only been tested with Pan) with manualActivation set to true, if a touch cancellation is triggered by the device (as can happen with palm rejection on an iPad), all touchable elements in the app become disabled until the next interaction with a gesture handler.

Link to video

Steps to reproduce

const App = () => {
  const pan = Gesture.Pan().manualActivation(true)

  return (
    <GestureHandlerRootView style={exampleStyles.root}>
      <TouchableHighlight
        onPress={() => console.log(2)}
        underlayColor={'red'}
        style={[exampleStyles.button, { backgroundColor: '#21da1a' }]}
      >
        <Text>OUTSIDE DETECTOR</Text>
      </TouchableHighlight>
      <GestureDetector gesture={pan}>
        <View style={exampleStyles.area} />
      </GestureDetector>
    </GestureHandlerRootView>
  );
}

const exampleStyles = StyleSheet.create({
  root: {
    flex: 1,
  },
  area: { flex: 1, backgroundColor: '#5e5e5e', marginTop: 100 },
  button: {
    width: 100,
    height: 100,
    backgroundColor: '#21da1a',
    zIndex: 100,
    position: 'absolute',
  },
});
  1. Call palm rejection on device
  2. Try to press button

Snack or a link to a repository

https://snack.expo.dev/eAEHgFwLcHz1WI4yBQlRt

Gesture Handler version

2.15.0

React Native version

0.73.6

Platforms

iOS

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

None

Build type

Debug mode

Device

Real device

Device model

iPad Pro (os 17.4.1)

Acknowledgements

Yes

antonkarytski avatar Apr 30 '24 13:04 antonkarytski