mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-10 17:22:45 +08:00
Added blurOnSubmit support to multine TextInput (aka RCTTextView)
Summary: public Setting `blurOnSubmit=true` on a multiline `<TextInput>` now causes it to behave like a single-line input with respect to the return key: With the default value of `false`, pressing return will enter a newline character into the field. If you set the value to `true`, pressing return will now blur the field and trigger the onSubmitEditing event. The newline character will *not* be added to the text. (See associated github task for dicussion: https://github.com/facebook/react-native/pull/2149) Reviewed By: javache Differential Revision: D2710448 fb-gh-sync-id: c9706ae11f8b399932d3400ceb4c7558e455570d
This commit is contained in:
committed by
facebook-github-bot-9
parent
807e0d9310
commit
37042573b8
@@ -548,6 +548,23 @@ exports.examples = [
|
||||
title: 'Blur on submit',
|
||||
render: function(): ReactElement { return <BlurOnSubmitExample />; },
|
||||
},
|
||||
{
|
||||
title: 'Multiline blur on submit',
|
||||
render: function() {
|
||||
return (
|
||||
<View>
|
||||
<TextInput
|
||||
style={styles.multiline}
|
||||
placeholder='blurOnSubmit = true'
|
||||
returnKeyType='next'
|
||||
blurOnSubmit={true}
|
||||
multiline={true}
|
||||
onSubmitEditing={event => alert(event.nativeEvent.text)}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Multiline',
|
||||
render: function() {
|
||||
|
||||
Reference in New Issue
Block a user