Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rejectResponderTermination prop to TextInput #16755

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Libraries/Components/TextInput/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,15 @@ const TextInput = createReactClass({
*/
inlineImagePadding: PropTypes.number,

/**
* If `true`, allows TextInput to pass touch events to the parent component.
* This allows components such as SwipeableListView to be swipeable from the TextInput on iOS,
* as is the case on Android by default.
* If `false`, TextInput always asks to handle the input (except when disabled).
* @platform ios
*/
rejectResponderTermination: PropTypes.bool,

/**
* Determines the types of data converted to clickable URLs in the text input.
* Only valid if `multiline={true}` and `editable={false}`.
Expand Down Expand Up @@ -859,6 +868,7 @@ const TextInput = createReactClass({
getDefaultProps() {
return {
allowFontScaling: true,
rejectResponderTermination: true,
underlineColorAndroid: 'transparent',
};
},
Expand Down Expand Up @@ -1079,7 +1089,7 @@ const TextInput = createReactClass({
<TouchableWithoutFeedback
onLayout={props.onLayout}
onPress={this._onPress}
rejectResponderTermination={true}
rejectResponderTermination={props.rejectResponderTermination}
accessible={props.accessible}
accessibilityLabel={props.accessibilityLabel}
accessibilityRole={props.accessibilityRole}
Expand Down