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 (
<Animated.View <GestureDetector gesture={composedGesture}>
ref={containerRef} <Animated.View
// Necessary to make opacity work for both children together. ref={containerRef}
renderToHardwareTextureAndroid // Necessary to make opacity work for both children together.
style={[styles.container, animatedStyle, {}]}> renderToHardwareTextureAndroid
<ActivityIndicator size="small" color="#FFF" style={styles.loading} /> style={[styles.container, animatedStyle, {}]}>
<GestureDetector gesture={composedGesture}> <ActivityIndicator size="small" color="#FFF" style={styles.loading} />
<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>
) )
} }