-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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 #11251
Changes from 1 commit
7f4fe15
6817f05
87e524b
9150975
c85aa82
d0bb66f
42879d2
a7fdca0
f3cbd4f
d93de22
2d88b63
8e0d54d
9faf324
43d1cf8
ec2f97a
5f3f3d4
62695a1
3a5572e
984cbb3
9eb9cfc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -574,6 +574,12 @@ const TextInput = createReactClass({ | |
*/ | ||
inlineImagePadding: PropTypes.number, | ||
|
||
/** | ||
* Allow TextInput to pass touch event to parent. | ||
* @platform ios | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this iOS only? Looks like a JS change. Does it not work on Android? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does not make any difference on Android, where the default behaviour is for a TextInput to pass the touch event to the parent. |
||
*/ | ||
rejectResponderTermination: PropTypes.bool, | ||
|
||
/** | ||
* Determines the types of data converted to clickable URLs in the text input. | ||
* Only valid if `multiline={true}` and `editable={false}`. | ||
|
@@ -601,11 +607,14 @@ const TextInput = createReactClass({ | |
*/ | ||
caretHidden: PropTypes.bool, | ||
}, | ||
|
||
getDefaultProps(): Object { | ||
return { | ||
rejectResponderTermination: false, | ||
allowFontScaling: true, | ||
}; | ||
}, | ||
|
||
/** | ||
* `NativeMethodsMixin` will look for this when invoking `setNativeProps`. We | ||
* make `this` look like an actual native component class. | ||
|
@@ -770,7 +779,7 @@ const TextInput = createReactClass({ | |
<TouchableWithoutFeedback | ||
onLayout={props.onLayout} | ||
onPress={this._onPress} | ||
rejectResponderTermination={true} | ||
rejectResponderTermination={props.rejectResponderTermination} | ||
accessible={props.accessible} | ||
accessibilityLabel={props.accessibilityLabel} | ||
accessibilityTraits={props.accessibilityTraits} | ||
|
@@ -859,9 +868,9 @@ const TextInput = createReactClass({ | |
// Make sure to fire the mostRecentEventCount first so it is already set on | ||
// native when the text value is set. | ||
if (this._inputRef) { | ||
this._inputRef.setNativeProps({ | ||
mostRecentEventCount: event.nativeEvent.eventCount, | ||
}); | ||
this._inputRef.setNativeProps({ | ||
mostRecentEventCount: event.nativeEvent.eventCount, | ||
}); | ||
} | ||
|
||
var text = event.nativeEvent.text; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this comment. Could you extend it please explaining how and why someone would want to use this prop?
EDIT: I understand it now but only after reading the summary in this PR. Without it people will probably not know what this doc block means.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, will update the comment, thanks