diff --git a/Examples/UIExplorer/TextInputExample.ios.js b/Examples/UIExplorer/TextInputExample.ios.js index 92359b178..5f13d822f 100644 --- a/Examples/UIExplorer/TextInputExample.ios.js +++ b/Examples/UIExplorer/TextInputExample.ios.js @@ -75,6 +75,11 @@ var TextEventsExample = React.createClass({ onSubmitEditing={(event) => this.updateText( 'onSubmitEditing text: ' + event.nativeEvent.text )} + onSelectionChange={(event) => this.updateText( + 'onSelectionChange range: ' + + event.nativeEvent.selection.start + ',' + + event.nativeEvent.selection.end + )} onKeyPress={(event) => { this.updateText('onKeyPress key: ' + event.nativeEvent.key); }} diff --git a/Libraries/Components/TextInput/TextInput.js b/Libraries/Components/TextInput/TextInput.js index 4e07f5620..a39362af1 100644 --- a/Libraries/Components/TextInput/TextInput.js +++ b/Libraries/Components/TextInput/TextInput.js @@ -414,7 +414,7 @@ var TextInput = React.createClass({ var onSelectionChange; if (this.props.selectionState || this.props.onSelectionChange) { - onSelectionChange = function(event: Event) { + onSelectionChange = (event: Event) => { if (this.props.selectionState) { var selection = event.nativeEvent.selection; this.props.selectionState.update(selection.start, selection.end);