Skip to content

Commit b7b0e23

Browse files
yungstersfacebook-github-bot
authored andcommitted
TextInput: Add onPressIn and onPressOut
Summary: Introduces support for `onPressIn` and `onPressOut` on the `TextInput` component. This makes it possible to add visual feedback when users touch interact with `TextInput` components. Changelog: [General][Added] - TextInput now supports `onPressIn` and `onPressOut`. Reviewed By: TheSavior Differential Revision: D23514333 fbshipit-source-id: 1790e977b78f1c293d5476aef8613547f27d6731
1 parent 1b994f9 commit b7b0e23

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Libraries/Components/TextInput/TextInput.js

+12
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,16 @@ export type Props = $ReadOnly<{|
571571
*/
572572
onEndEditing?: ?(e: EditingEvent) => mixed,
573573

574+
/**
575+
* Called when a touch is engaged.
576+
*/
577+
onPressIn?: ?(event: PressEvent) => mixed,
578+
579+
/**
580+
* Called when a touch is released.
581+
*/
582+
onPressOut?: ?(event: PressEvent) => mixed,
583+
574584
/**
575585
* Callback that is called when the text input selection is changed.
576586
* This will be called with
@@ -1135,6 +1145,8 @@ function InternalTextInput(props: Props): React.Node {
11351145
<TouchableWithoutFeedback
11361146
onLayout={props.onLayout}
11371147
onPress={_onPress}
1148+
onPressIn={props.onPressIn}
1149+
onPressOut={props.onPressOut}
11381150
accessible={props.accessible}
11391151
accessibilityLabel={props.accessibilityLabel}
11401152
accessibilityRole={props.accessibilityRole}

0 commit comments

Comments
 (0)