From 4b51a65ae4c5e3d269696ea7d72371550addc6dd Mon Sep 17 00:00:00 2001 From: Ellis Tsung Date: Tue, 8 Aug 2023 16:16:23 -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: de736df4fa66f423fc647f4c858834f3acd3b386 --- .../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 b8d86021e17105..3a1fa5684a0bd9 100644 --- a/packages/react-native/Libraries/Components/TextInput/TextInput.js +++ b/packages/react-native/Libraries/Components/TextInput/TextInput.js @@ -1380,6 +1380,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) { @@ -1394,6 +1395,7 @@ function InternalTextInput(props: Props): React.Node { }), [ props.editable, + props.hitSlop, props.onPressIn, props.onPressOut, props.rejectResponderTermination,