Skip to content

Commit

Permalink
Merge branch 'main' into 2.23-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
m-bert committed Feb 10, 2025
2 parents fa2f309 + 03be039 commit 1a6ef8a
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 19 deletions.
4 changes: 2 additions & 2 deletions FabricExample/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,7 @@ PODS:
- React-logger (= 0.77.0)
- React-perflogger (= 0.77.0)
- React-utils (= 0.77.0)
- RNGestureHandler (2.23.0):
- RNGestureHandler (2.23.1):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -1801,7 +1801,7 @@ SPEC CHECKSUMS:
ReactAppDependencyProvider: 6e8d68583f39dc31ee65235110287277eb8556ef
ReactCodegen: c08a5113d9c9c895fe10f3c296f74c6b705a60a9
ReactCommon: 1bd2dc684d7992acbf0dfee887b89a57a1ead86d
RNGestureHandler: b57c633defe01be73dfed9d645158fb21d6039d4
RNGestureHandler: 93014de1ee4e1d539a74c6ce7aea72edd1fff6e0
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
Yoga: 78d74e245ed67bb94275a1316cdc170b9b7fe884

Expand Down
8 changes: 4 additions & 4 deletions MacOSExample/macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,7 @@ PODS:
- React-utils (= 0.74.6)
- RNCAsyncStorage (1.24.0):
- React-Core
- RNGestureHandler (2.23.0):
- RNGestureHandler (2.23.1):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -1443,10 +1443,10 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
boost: 0686b6af8cbd638c784fea5afb789be66699823c
DoubleConversion: 5b92c4507c560bb62e7aa1acdf2785ea3ff08b3b
DoubleConversion: acaf5db79676d2e9119015819153f0f99191de12
FBLazyVector: 8f41053475f558b29633b434bd62929813a38560
fmt: 03574da4b7ba40de39da59677ca66610ce8c4a02
glog: ba31c1afa7dcf1915a109861bccdb4421be6175b
glog: 6df0a3d6e2750a50609471fd1a01fd2948d405b5
hermes-engine: 21ea4e6a0b64854652c8c20cb815efdbb3131fdd
RCT-Folly: 2edbb9597acadc2312235c7ad6243d49852047a3
RCTDeprecation: 5f1d7e1f8ef6c53f0207e3ac0d0ca23575e8a6ab
Expand Down Expand Up @@ -1496,7 +1496,7 @@ SPEC CHECKSUMS:
React-utils: d1f30e28b14bea6aa6b009be03ab502bbf2cf5c6
ReactCommon: 68cae4af53cf2d34e6a26c0099f434f170495dd1
RNCAsyncStorage: ec53e44dc3e75b44aa2a9f37618a49c3bc080a7a
RNGestureHandler: 2e6a9c6361b44a11795d51353445d65ba558cb1d
RNGestureHandler: 006e7ebf1a3d37843d951031389fb12712c7dd8e
RNReanimated: 45553a3ae29a75a76269595f8554d07d4090e392
RNSVG: 4590aa95758149fa27c5c83e54a6a466349a1688
SocketRocket: f6c6249082c011e6de2de60ed641ef8bbe0cfac9
Expand Down
8 changes: 8 additions & 0 deletions RNGestureHandler.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,12 @@ Pod::Spec.new do |s|
else
s.dependency "React-Core"
end

if ENV['USE_FRAMEWORKS'] != nil && ENV['RCT_NEW_ARCH_ENABLED'] == '1'
add_dependency(s, "React-FabricComponents", :additional_framework_paths => [
"react/renderer/textlayoutmanager/platform/ios",
"react/renderer/components/textinput/platform/ios",
])
end

end
14 changes: 12 additions & 2 deletions apple/RNGestureHandlerButton.mm
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,20 @@ - (BOOL)shouldHandleTouch:(RNGHUIView *)view
return button.userEnabled;
}

// Certain subviews such as RCTViewComponentView have been observed to have disabled
// accessibility gesture recognizers such as _UIAccessibilityHUDGateGestureRecognizer,
// ostensibly set by iOS. Such gesture recognizers cause this function to return YES
// even when the passed view is static text and does not respond to touches. This in
// turn prevents the button from receiving touches, breaking functionality. To handle
// such case, we can count only the enabled gesture recognizers when determining
// whether a view should receive touches.
NSPredicate *isEnabledPredicate = [NSPredicate predicateWithFormat:@"isEnabled == YES"];
NSArray *enabledGestureRecognizers = [view.gestureRecognizers filteredArrayUsingPredicate:isEnabledPredicate];

#if !TARGET_OS_OSX
return [view isKindOfClass:[UIControl class]] || [view.gestureRecognizers count] > 0;
return [view isKindOfClass:[UIControl class]] || [enabledGestureRecognizers count] > 0;
#else
return [view isKindOfClass:[NSControl class]] || [view.gestureRecognizers count] > 0;
return [view isKindOfClass:[NSControl class]] || [enabledGestureRecognizers count] > 0;
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/components/touchables.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sidebar_label: Touchables
---

:::warning
Touchables will be removed in the future version of Gesture Handler.
Touchables will be removed in the future version of Gesture Handler. Use Pressable instead.
:::

Gesture Handler library provides an implementation of RN's touchable components that are based on [native buttons](buttons.mdx) and does not rely on JS responder system utilized by RN. Our touchable implementation follows the same API and aims to be a drop-in replacement for touchables available in React Native.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-gesture-handler",
"version": "2.23.0",
"version": "2.23.1",
"description": "Declarative API exposing native platform touch and gesture system to React Native",
"scripts": {
"prepare": "bob build && husky install",
Expand Down
4 changes: 2 additions & 2 deletions src/components/touchables/TouchableHighlight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ interface State {
}

/**
* @deprecated TouchableHighlight will be removed in the future version of Gesture Handler.
* @deprecated TouchableHighlight will be removed in the future version of Gesture Handler. Use Pressable instead.
*/
export type TouchableHighlightProps = RNTouchableHighlightProps &
GenericTouchableProps;

/**
* @deprecated TouchableHighlight will be removed in the future version of Gesture Handler.
* @deprecated TouchableHighlight will be removed in the future version of Gesture Handler. Use Pressable instead.
*
* TouchableHighlight follows RN's implementation
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from './TouchableNativeFeedbackProps';

/**
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler.
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
*
* TouchableNativeFeedback behaves slightly different than RN's TouchableNativeFeedback.
* There's small difference with handling long press ripple since RN's implementation calls
Expand Down
2 changes: 1 addition & 1 deletion src/components/touchables/TouchableNativeFeedback.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { TouchableNativeFeedback as RNTouchableNativeFeedback } from 'react-native';

/**
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler.
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
*/
const TouchableNativeFeedback = RNTouchableNativeFeedback;

Expand Down
2 changes: 1 addition & 1 deletion src/components/touchables/TouchableNativeFeedbackProps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type TouchableNativeFeedbackExtraProps = {
};

/**
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler.
* @deprecated TouchableNativeFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
*/
export type TouchableNativeFeedbackProps = RNTouchableNativeFeedbackProps &
GenericTouchableProps;
4 changes: 2 additions & 2 deletions src/components/touchables/TouchableOpacity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ import * as React from 'react';
import { Component } from 'react';

/**
* @deprecated TouchableOpacity will be removed in the future version of Gesture Handler.
* @deprecated TouchableOpacity will be removed in the future version of Gesture Handler. Use Pressable instead.
*/
export type TouchableOpacityProps = RNTouchableOpacityProps &
GenericTouchableProps & {
useNativeAnimations?: boolean;
};

/**
* @deprecated TouchableOpacity will be removed in the future version of Gesture Handler.
* @deprecated TouchableOpacity will be removed in the future version of Gesture Handler. Use Pressable instead.
*
* TouchableOpacity bases on timing animation which has been used in RN's core
*/
Expand Down
4 changes: 2 additions & 2 deletions src/components/touchables/TouchableWithoutFeedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import GenericTouchable from './GenericTouchable';
import type { GenericTouchableProps } from './GenericTouchableProps';

/**
* @deprecated TouchableWithoutFeedback will be removed in the future version of Gesture Handler.
* @deprecated TouchableWithoutFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
*/
export type TouchableWithoutFeedbackProps = GenericTouchableProps;

/**
* @deprecated TouchableWithoutFeedback will be removed in the future version of Gesture Handler.
* @deprecated TouchableWithoutFeedback will be removed in the future version of Gesture Handler. Use Pressable instead.
*/
const TouchableWithoutFeedback = React.forwardRef<
GenericTouchable,
Expand Down

0 comments on commit 1a6ef8a

Please sign in to comment.