Skip to content

Commit

Permalink
Fix app crash caused by TextInput.
Browse files Browse the repository at this point in the history
Reviewed By: zjj010104

Differential Revision: D2761644

fb-gh-sync-id: 89241de2f8c84d569ec452871f740a0d655cc95e
  • Loading branch information
Hedger Wang authored and facebook-github-bot-7 committed Dec 16, 2015
1 parent 4e2a316 commit 53d18c8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Libraries/Components/TextInput/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,12 @@ var TextInput = React.createClass({
this.props.onChange && this.props.onChange(event);
this.props.onChangeText && this.props.onChangeText(text);

if (!this.refs.input) {
// calling `this.props.onChange` or `this.props.onChangeText`
// may clean up the input itself. Exits here.
return;
}

// This is necessary in case native updates the text and JS decides
// that the update should be ignored and we should stick with the value
// that we have in JS.
Expand Down

0 comments on commit 53d18c8

Please sign in to comment.