diff --git a/js/TextInputExample.android.js b/js/TextInputExample.android.js index 04d438684..e70d7d1ba 100644 --- a/js/TextInputExample.android.js +++ b/js/TextInputExample.android.js @@ -27,6 +27,7 @@ class TextEventsExample extends React.Component<{}, $FlowFixMeState> { curText: '', prevText: '', prev2Text: '', + prev3Text: '', }; updateText = (text) => { @@ -35,6 +36,7 @@ class TextEventsExample extends React.Component<{}, $FlowFixMeState> { curText: text, prevText: state.curText, prev2Text: state.prevText, + prev3Text: state.prev2Text, }; }); }; @@ -46,6 +48,7 @@ class TextEventsExample extends React.Component<{}, $FlowFixMeState> { autoCapitalize="none" placeholder="Enter text to see events" autoCorrect={false} + multiline onFocus={() => this.updateText('onFocus')} onBlur={() => this.updateText('onBlur')} onChange={(event) => this.updateText( @@ -60,12 +63,16 @@ class TextEventsExample extends React.Component<{}, $FlowFixMeState> { onSubmitEditing={(event) => this.updateText( 'onSubmitEditing text: ' + event.nativeEvent.text )} + onKeyPress={(event) => this.updateText( + 'onKeyPress key: ' + event.nativeEvent.key + )} style={styles.singleLine} /> {this.state.curText}{'\n'} (prev: {this.state.prevText}){'\n'} - (prev2: {this.state.prev2Text}) + (prev2: {this.state.prev2Text}){'\n'} + (prev3: {this.state.prev3Text}) );