[Android] onSubmitEditing not happening when blurOnSubmit is false
See original GitHub issueIs this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
OS: macOS Sierra 10.12.3
Node: 8.6.0
Yarn: 0.27.5
npm: 5.3.0
Watchman: 4.7.0
Xcode: Xcode 8.3.2 Build version 8E2002
Android Studio: 2.3 AI-162.4069837
Packages: (wanted => installed)
react: 16.0.0-alpha.12 => 16.0.0-alpha.12
react-native: 0.48.4 => 0.48.4
Target Platform
Android
compileSdkVersion 23
buildToolsVersion "25.0.0"
minSdkVersion 16
targetSdkVersion 23
Steps to Reproduce
(Write your steps here:)
- Make the TextInput maintain focus when pressing the submit button on Android
- Add
onSubmitEditing={this.submit}
andblurOnSubmit={false}
- The
this.submit
method never gets called
Expected Behavior
The submit method should be called
Actual Behavior
The submit method does not call. If I remove the blurOnSubmit={false}
or set it to true, the method calls as expected.
Code example
class Input extends Component {
submit() {
console.log('Submitting');
}
render() {
return (
<TextInput
editable={true}
keyboardType='phone-pad'
onSubmitEditing={this.submit}
blurOnSubmit={false}
returnKeyType="next"
/>
)
}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
textinput text not submitting using onsubmitEditing using ...
you have to pass text from submit event to the function, <TextInput onSubmitEditing={(event) => this.onSubmit(event.nativeEvent.text)} />.
Read more >TextInput · React Native
If true, the text input can be multiple lines. The default value is false. Type, Required. bool, No. onBlur.
Read more >TextInput - React Native
The default value is true for single-line fields and false for multiline fields. Note that for multiline fields, setting blurOnSubmit to true ...
Read more >React Native Keyboard Avoiding View and Request Focus
This is an Example of Request Focus and Keyboard Avoiding View in React Native. While working with TextInput in native app development..
Read more >React Native Text Input Component - GeeksforGeeks
In the default case, it will be false,; blurOnSubmit: It is used to blur the ... It will not allow users to edit...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can confirm this is also the case on
0.49.3
.@kelset Sorry, I was too quick! Yes, the method does call when removing the
blurOnSubmit
property (or setting it to false) so the linking is not the problem.I noticed this after upgrading React & React Native, and also some target SDKs.