From 5ea4d397a952e336d6b62ea01d02a4d357cfedcf Mon Sep 17 00:00:00 2001 From: Aleksei Androsov Date: Sat, 16 Jan 2016 14:49:40 +0300 Subject: [PATCH] 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. --- Libraries/Components/TextInput/TextInput.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Libraries/Components/TextInput/TextInput.js b/Libraries/Components/TextInput/TextInput.js index b029db359..97b201280 100644 --- a/Libraries/Components/TextInput/TextInput.js +++ b/Libraries/Components/TextInput/TextInput.js @@ -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) {