From 768c9604a2240ae821f3e0477fe1ad643f9b35ef Mon Sep 17 00:00:00 2001 From: Ellis Tsung Date: Tue, 8 Aug 2023 17:30:11 -0700 Subject: [PATCH] Pass hitSlop prop into TextInput Pressability config (#38857) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/38857 `hitSlop` must be passed into the `usePressability` hook in order for it to take effect. It's a no-op if no hit slop is present Changelog: [Internal][Fixed] - Propagate hit slop prop to TextInput pressability config Reviewed By: NickGerleman Differential Revision: D48124538 fbshipit-source-id: a910fdcec55e67d37c84facca297428556ef777e --- .../react-native/Libraries/Components/TextInput/TextInput.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react-native/Libraries/Components/TextInput/TextInput.js b/packages/react-native/Libraries/Components/TextInput/TextInput.js index 67ad18c0c19b42..21271917a97f4d 100644 --- a/packages/react-native/Libraries/Components/TextInput/TextInput.js +++ b/packages/react-native/Libraries/Components/TextInput/TextInput.js @@ -1347,6 +1347,7 @@ function InternalTextInput(props: Props): React.Node { const config = React.useMemo( () => ({ + hitSlop: props.hitSlop, onPress: (event: PressEvent) => { if (props.editable !== false) { if (inputRef.current != null) { @@ -1361,6 +1362,7 @@ function InternalTextInput(props: Props): React.Node { }), [ props.editable, + props.hitSlop, props.onPressIn, props.onPressOut, props.rejectResponderTermination,