react-native-gesture-handler 2.31.0-nightly-20260121-59a5311e3 → 2.31.0-nightly-20260122-b776a8137

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.
@@ -54,6 +54,9 @@ public class RNGestureHandlerButtonManagerDelegate<T extends View, U extends Bas
54
54
  case "borderStyle":
55
55
  mViewManager.setBorderStyle(view, value == null ? "solid" : (String) value);
56
56
  break;
57
+ case "pointerEvents":
58
+ mViewManager.setPointerEvents(view, (String) value);
59
+ break;
57
60
  default:
58
61
  super.setProperty(view, propName, value);
59
62
  }
@@ -24,4 +24,5 @@ public interface RNGestureHandlerButtonManagerInterface<T extends View> extends
24
24
  void setBorderWidth(T view, float value);
25
25
  void setBorderColor(T view, @Nullable Integer value);
26
26
  void setBorderStyle(T view, @Nullable String value);
27
+ void setPointerEvents(T view, @Nullable String value);
27
28
  }
@@ -27,6 +27,8 @@ import androidx.core.view.children
27
27
  import com.facebook.react.R
28
28
  import com.facebook.react.module.annotations.ReactModule
29
29
  import com.facebook.react.uimanager.PixelUtil
30
+ import com.facebook.react.uimanager.PointerEvents
31
+ import com.facebook.react.uimanager.ReactPointerEventsView
30
32
  import com.facebook.react.uimanager.ThemedReactContext
31
33
  import com.facebook.react.uimanager.ViewGroupManager
32
34
  import com.facebook.react.uimanager.ViewManagerDelegate
@@ -132,6 +134,17 @@ class RNGestureHandlerButtonViewManager :
132
134
  view.isSoundEffectsEnabled = !touchSoundDisabled
133
135
  }
134
136
 
137
+ @ReactProp(name = ViewProps.POINTER_EVENTS)
138
+ override fun setPointerEvents(view: ButtonViewGroup, pointerEvents: String?) {
139
+ view.pointerEvents = when (pointerEvents) {
140
+ "none" -> PointerEvents.NONE
141
+ "box-none" -> PointerEvents.BOX_NONE
142
+ "box-only" -> PointerEvents.BOX_ONLY
143
+ "auto", null -> PointerEvents.AUTO
144
+ else -> PointerEvents.AUTO
145
+ }
146
+ }
147
+
135
148
  override fun onAfterUpdateTransaction(view: ButtonViewGroup) {
136
149
  super.onAfterUpdateTransaction(view)
137
150
 
@@ -142,7 +155,8 @@ class RNGestureHandlerButtonViewManager :
142
155
 
143
156
  class ButtonViewGroup(context: Context?) :
144
157
  ViewGroup(context),
145
- NativeViewGestureHandler.NativeViewGestureHandlerHook {
158
+ NativeViewGestureHandler.NativeViewGestureHandlerHook,
159
+ ReactPointerEventsView {
146
160
  // Using object because of handling null representing no value set.
147
161
  var rippleColor: Int? = null
148
162
  set(color) = withBackgroundUpdate {
@@ -200,6 +214,8 @@ class RNGestureHandlerButtonViewManager :
200
214
 
201
215
  var exclusive = true
202
216
 
217
+ override var pointerEvents: PointerEvents = PointerEvents.AUTO
218
+
203
219
  private var buttonBackgroundColor = Color.TRANSPARENT
204
220
  private var needBackgroundUpdate = false
205
221
  private var lastEventTime = -1L
@@ -223,12 +223,17 @@ static RNGestureHandlerPointerEvents RCTPointerEventsToEnum(facebook::react::Poi
223
223
  _buttonView.hitTestEdgeInsets = UIEdgeInsetsMake(
224
224
  -newProps.hitSlop.top, -newProps.hitSlop.left, -newProps.hitSlop.bottom, -newProps.hitSlop.right);
225
225
 
226
+ // We need to cast to ViewProps to access the pointerEvents property with the correct type.
227
+ // This is necessary because pointerEvents is redefined in the spec,
228
+ // which shadows the base property with a different, incompatible type.
229
+ const auto &newViewProps = static_cast<const ViewProps &>(newProps);
226
230
  if (!oldProps) {
227
- _buttonView.pointerEvents = RCTPointerEventsToEnum(newProps.pointerEvents);
231
+ _buttonView.pointerEvents = RCTPointerEventsToEnum(newViewProps.pointerEvents);
228
232
  } else {
229
233
  const auto &oldButtonProps = *std::static_pointer_cast<const RNGestureHandlerButtonProps>(oldProps);
230
- if (oldButtonProps.pointerEvents != newProps.pointerEvents) {
231
- _buttonView.pointerEvents = RCTPointerEventsToEnum(newProps.pointerEvents);
234
+ const auto &oldViewProps = static_cast<const ViewProps &>(oldButtonProps);
235
+ if (oldViewProps.pointerEvents != newViewProps.pointerEvents) {
236
+ _buttonView.pointerEvents = RCTPointerEventsToEnum(newViewProps.pointerEvents);
232
237
  }
233
238
  }
234
239
 
@@ -6,6 +6,7 @@ import type {
6
6
  } from 'react-native/Libraries/Types/CodegenTypes';
7
7
  import type { ViewProps, ColorValue } from 'react-native';
8
8
 
9
+ // @ts-ignore - Redefining pointerEvents with WithDefault for codegen, conflicts with ViewProps type but codegen needs it
9
10
  interface NativeProps extends ViewProps {
10
11
  exclusive?: WithDefault<boolean, true>;
11
12
  foreground?: boolean;
@@ -17,6 +18,10 @@ interface NativeProps extends ViewProps {
17
18
  borderWidth?: Float;
18
19
  borderColor?: ColorValue;
19
20
  borderStyle?: WithDefault<string, 'solid'>;
21
+ pointerEvents?: WithDefault<
22
+ 'box-none' | 'none' | 'box-only' | 'auto',
23
+ 'auto'
24
+ >;
20
25
  }
21
26
 
22
27
  export default codegenNativeComponent<NativeProps>('RNGestureHandlerButton');
@@ -6,6 +6,7 @@ import type {
6
6
  } from 'react-native/Libraries/Types/CodegenTypes';
7
7
  import type { ViewProps, ColorValue } from 'react-native';
8
8
 
9
+ // @ts-ignore - Redefining pointerEvents with WithDefault for codegen, conflicts with ViewProps type but codegen needs it
9
10
  interface NativeProps extends ViewProps {
10
11
  exclusive?: WithDefault<boolean, true>;
11
12
  foreground?: boolean;
@@ -17,6 +18,10 @@ interface NativeProps extends ViewProps {
17
18
  borderWidth?: Float;
18
19
  borderColor?: ColorValue;
19
20
  borderStyle?: WithDefault<string, 'solid'>;
21
+ pointerEvents?: WithDefault<
22
+ 'box-none' | 'none' | 'box-only' | 'auto',
23
+ 'auto'
24
+ >;
20
25
  }
21
26
 
22
27
  export default codegenNativeComponent<NativeProps>('RNGestureHandlerButton');
@@ -11,6 +11,7 @@ interface NativeProps extends ViewProps {
11
11
  borderWidth?: Float;
12
12
  borderColor?: ColorValue;
13
13
  borderStyle?: WithDefault<string, 'solid'>;
14
+ pointerEvents?: WithDefault<'box-none' | 'none' | 'box-only' | 'auto', 'auto'>;
14
15
  }
15
16
  declare const _default: import("react-native/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
16
17
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"RNGestureHandlerButtonNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/specs/RNGestureHandlerButtonNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,KAAK,EACL,WAAW,EACX,KAAK,EACN,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1D,UAAU,WAAY,SAAQ,SAAS;IACrC,SAAS,CAAC,EAAE,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACrC,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,kBAAkB,CAAC,EAAE,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACjD,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5C;;AAED,wBAA6E"}
1
+ {"version":3,"file":"RNGestureHandlerButtonNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/specs/RNGestureHandlerButtonNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,KAAK,EACL,WAAW,EACX,KAAK,EACN,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1D,UAAU,WAAY,SAAQ,SAAS;IACrC,SAAS,CAAC,EAAE,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACrC,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,kBAAkB,CAAC,EAAE,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACjD,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,aAAa,CAAC,EAAE,WAAW,CACzB,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,EACzC,MAAM,CACP,CAAC;CACH;;AAED,wBAA6E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-gesture-handler",
3
- "version": "2.31.0-nightly-20260121-59a5311e3",
3
+ "version": "2.31.0-nightly-20260122-b776a8137",
4
4
  "description": "Declarative API exposing native platform touch and gesture system to React Native",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -6,6 +6,7 @@ import type {
6
6
  } from 'react-native/Libraries/Types/CodegenTypes';
7
7
  import type { ViewProps, ColorValue } from 'react-native';
8
8
 
9
+ // @ts-ignore - Redefining pointerEvents with WithDefault for codegen, conflicts with ViewProps type but codegen needs it
9
10
  interface NativeProps extends ViewProps {
10
11
  exclusive?: WithDefault<boolean, true>;
11
12
  foreground?: boolean;
@@ -17,6 +18,10 @@ interface NativeProps extends ViewProps {
17
18
  borderWidth?: Float;
18
19
  borderColor?: ColorValue;
19
20
  borderStyle?: WithDefault<string, 'solid'>;
21
+ pointerEvents?: WithDefault<
22
+ 'box-none' | 'none' | 'box-only' | 'auto',
23
+ 'auto'
24
+ >;
20
25
  }
21
26
 
22
27
  export default codegenNativeComponent<NativeProps>('RNGestureHandlerButton');