From 5006eca4a84e0d57a1f57e611081338cbc2fa2dd Mon Sep 17 00:00:00 2001 From: Christopher Date: Wed, 15 Jul 2015 08:23:48 -0700 Subject: [PATCH] =?UTF-8?q?[TextInput]=20Remove=20focus=20on=20TextInput?= =?UTF-8?q?=20if=20property=20`editable`=20is=20=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Clicking on a TextField with editable set to false still would trigger a keyboard event. In this case that the TextField was a multiline, it would scroll you down to the bottom. Closes https://github.com/facebook/react-native/pull/1855 Github Author: Christopher --- Libraries/Components/TextInput/TextInput.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Libraries/Components/TextInput/TextInput.js b/Libraries/Components/TextInput/TextInput.js index 141cefab0..cc1b00b41 100644 --- a/Libraries/Components/TextInput/TextInput.js +++ b/Libraries/Components/TextInput/TextInput.js @@ -537,7 +537,9 @@ var TextInput = React.createClass({ }, _onPress: function(event: Event) { - this.focus(); + if (this.props.editable || this.props.editable === undefined) { + this.focus(); + } }, _onChange: function(event: Event) {