Skip to content

Commit 768c960

Browse files
el1tLuna Wei
authored and
Luna Wei
committed
Pass hitSlop prop into TextInput Pressability config (#38857)
Summary: Pull Request resolved: #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
1 parent 2f6c200 commit 768c960

File tree

1 file changed

+2
-0
lines changed
  • packages/react-native/Libraries/Components/TextInput

1 file changed

+2
-0
lines changed

packages/react-native/Libraries/Components/TextInput/TextInput.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,6 +1347,7 @@ function InternalTextInput(props: Props): React.Node {
13471347

13481348
const config = React.useMemo(
13491349
() => ({
1350+
hitSlop: props.hitSlop,
13501351
onPress: (event: PressEvent) => {
13511352
if (props.editable !== false) {
13521353
if (inputRef.current != null) {
@@ -1361,6 +1362,7 @@ function InternalTextInput(props: Props): React.Node {
13611362
}),
13621363
[
13631364
props.editable,
1365+
props.hitSlop,
13641366
props.onPressIn,
13651367
props.onPressOut,
13661368
props.rejectResponderTermination,

0 commit comments

Comments
 (0)