Skip to content

Commit

Permalink
Pass hitSlop prop into TextInput Pressability config (facebook#38857)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#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: 1d95259cd0dfd02f3646022d1fe7f4d39e66a9fa
  • Loading branch information
el1t authored and facebook-github-bot committed Aug 8, 2023
1 parent 93d9248 commit 2fd81a5
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -1394,6 +1395,7 @@ function InternalTextInput(props: Props): React.Node {
}),
[
props.editable,
props.hitSlop,
props.onPressIn,
props.onPressOut,
props.rejectResponderTermination,
Expand Down

0 comments on commit 2fd81a5

Please sign in to comment.