mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-06 22:44:22 +08:00
TextInput should call blur and focus methods of selectionState
DocumentSelectionState returns anchor and focus offsets only in focused state. So TextInput should set proper state to selectionState when blur and focus.
This commit is contained in:
@@ -549,6 +549,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) {
|
||||
@@ -589,6 +593,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) {
|
||||
|
||||
Reference in New Issue
Block a user