react-native-gesture-handler 3.3.0 → 3.4.0-nightly-20260914-a2e043092

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -871,9 +871,11 @@ class GestureHandlerOrchestrator(
871
871
  // A child view is handling touch, also extract handlers attached to this view
872
872
  if (found) {
873
873
  recordViewHandlersForPointer(view, coords, pointerId, event)
874
- } else if (view is RNGestureHandlerDetectorView) {
874
+ } else if (view is RNGestureHandlerDetectorView && !allChildrenHidden(view)) {
875
875
  // No child consumed the touch, but we still record the detector's own handlers so
876
- // that `hitSlop` expansion keeps working. The detector's frame ignores
876
+ // that `hitSlop` expansion keeps working. Skipped when every child is hidden or
877
+ // below the alpha gate, otherwise the detector would stay tappable while its
878
+ // content is invisible. The detector's frame ignores
877
879
  // child transforms, so for a single-child detector we check bounds in the child's
878
880
  // transform-aware coordinate space - otherwise the detector would steal presses over
879
881
  // areas its content has been moved away from.
@@ -911,6 +913,10 @@ class GestureHandlerOrchestrator(
911
913
 
912
914
  private fun canReceiveEvents(view: View) = view.visibility == View.VISIBLE && view.alpha >= minimumAlphaForTraversal
913
915
 
916
+ // True when the group has children and none of them can receive events (hidden or below the alpha gate).
917
+ private fun allChildrenHidden(viewGroup: ViewGroup) =
918
+ viewGroup.childCount > 0 && (0 until viewGroup.childCount).none { canReceiveEvents(viewGroup.getChildAt(it)) }
919
+
914
920
  // if view is not a view group it is clipping, otherwise we check for `getClipChildren` flag to
915
921
  // be turned on and also confirm with the ViewConfigHelper implementation
916
922
  private fun isClipping(view: View) = view !is ViewGroup || viewConfigHelper.isViewClippingChildren(view)
@@ -185,7 +185,8 @@ class RNGestureHandlerRootHelper(private val context: ReactContext, wrappedView:
185
185
  }
186
186
 
187
187
  companion object {
188
- private const val MIN_ALPHA_FOR_TOUCH = 0.1f
188
+ // Same threshold as UIKit / RCTViewComponentView hit testing on iOS.
189
+ private const val MIN_ALPHA_FOR_TOUCH = 0.01f
189
190
  private fun findRootViewTag(viewGroup: ViewGroup): ViewGroup {
190
191
  UiThreadUtil.assertOnUiThread()
191
192
  var parent: ViewParent? = viewGroup
@@ -613,8 +613,14 @@ static RNGestureHandlerPointerEvents RCTPointerEventsToEnum(facebook::react::Poi
613
613
  // This is necessary because RCTViewComponentView's hitTest might handle pointerEvents
614
614
  // from ViewProps and prevent touches from reaching _buttonView (which is the contentView).
615
615
  // Since _buttonView has its own pointerEvents handling, we always forward to it.
616
+ // Keep the visibility checks RCTViewComponentView applies, so a hidden or
617
+ // (nearly) transparent button is skipped like any other RN view.
616
618
  - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
617
619
  {
620
+ if (!self.userInteractionEnabled || self.hidden || self.alpha < 0.01) {
621
+ return nil;
622
+ }
623
+
618
624
  if (![self pointInside:point withEvent:event]) {
619
625
  return nil;
620
626
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-gesture-handler",
3
- "version": "3.3.0",
3
+ "version": "3.4.0-nightly-20260914-a2e043092",
4
4
  "description": "Declarative API exposing native platform touch and gesture system to React Native",
5
5
  "scripts": {
6
6
  "test": "jest",