Fix gesture recognition outside image

This commit is contained in:
Dan Abramov
2024-11-03 02:20:59 +00:00
parent 5743c4d148
commit a7788e414b
@@ -293,13 +293,13 @@ const ImageItem = ({
) )
return ( return (
<GestureDetector gesture={composedGesture}>
<Animated.View <Animated.View
ref={containerRef} ref={containerRef}
// Necessary to make opacity work for both children together. // Necessary to make opacity work for both children together.
renderToHardwareTextureAndroid renderToHardwareTextureAndroid
style={[styles.container, animatedStyle, {}]}> style={[styles.container, animatedStyle, {}]}>
<ActivityIndicator size="small" color="#FFF" style={styles.loading} /> <ActivityIndicator size="small" color="#FFF" style={styles.loading} />
<GestureDetector gesture={composedGesture}>
<Image <Image
contentFit="contain" contentFit="contain"
source={{uri: imageSrc.uri}} source={{uri: imageSrc.uri}}
@@ -320,8 +320,8 @@ const ImageItem = ({
accessibilityIgnoresInvertColors accessibilityIgnoresInvertColors
cachePolicy="memory" cachePolicy="memory"
/> />
</GestureDetector>
</Animated.View> </Animated.View>
</GestureDetector>
) )
} }