TextInput should call blur and focus methods of selectionState
Summary: DocumentSelectionState returns anchor and focus offsets only in focused state. So TextInput should set proper state to selectionState when blur and focus. Closes https://github.com/facebook/react-native/pull/5354 Reviewed By: svcscm Differential Revision: D2890277 Pulled By: andreicoman11 fb-gh-sync-id: 84f96504e218cf7c70d7e24865ab074d882f3bea
This commit is contained in:
parent
eebea51b7c
commit
65b0913210
|
@ -525,6 +525,10 @@ var TextInput = React.createClass({
|
|||
if (this.props.onFocus) {
|
||||
this.props.onFocus(event);
|
||||
}
|
||||
|
||||
if (this.props.selectionState) {
|
||||
this.props.selectionState.focus();
|
||||
}
|
||||
},
|
||||
|
||||
_onPress: function(event: Event) {
|
||||
|
@ -565,6 +569,10 @@ var TextInput = React.createClass({
|
|||
if (this.props.onBlur) {
|
||||
this.props.onBlur(event);
|
||||
}
|
||||
|
||||
if (this.props.selectionState) {
|
||||
this.props.selectionState.blur();
|
||||
}
|
||||
},
|
||||
|
||||
_onTextInput: function(event: Event) {
|
||||
|
|
Loading…
Reference in New Issue