Skip to content

Commit 12cb193

Browse files
authored
[Android] Don't delay child pressed state in buttons (#4296)
## Description react/react-native#57127 added an override for `shouldDelayChildPressedState` in React Native containers to prevent them from delaying the pressed state in children. All components extending them will get this for free, but our button implementation doesn't extend `ReactViewGroup` but `ViewGroup`. This PR adds override for `shouldDelayChildPressedState` in `RNGestureHandlerButtonViewManager`.
1 parent 5e6ff91 commit 12cb193

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,8 @@ class RNGestureHandlerButtonViewManager :
10841084
// by default Viewgroup would pass hotspot change events
10851085
}
10861086

1087+
override fun shouldDelayChildPressedState(): Boolean = false
1088+
10871089
// Default to skipping the offscreen buffer so children's border anti-aliasing
10881090
// at the view edge isn't clipped by the layer bounds when alpha != 1.
10891091
// `needsOffscreenAlphaCompositing` opts back into the standard View behavior.

0 commit comments

Comments
 (0)