Skip to content

onSubmitEditing is no longer called when blurOnSubmit is false #15299

Closed
@janicduplessis

Description

@janicduplessis

The use case where this causes an issue is to focus the next text input with the keyboard "next" button. To detect that the "next" button was pressed I use onSubmitEditing but it is not called anymore when blurOnSubmit is false. Right now I have to set blurOnSubmit to true but causes the keyboard to close a bit then reopen which is bad instead of just staying opened.

Looks like the logic changed in the recent refactors:

Old delegate implementation

- (BOOL)textFieldShouldEndEditing:(RCTTextField *)textField

and
- (BOOL)textFieldShouldEndEditing:(RCTTextField *)textField

New implementation

https://github.com/facebook/react-native/blob/master/Libraries/Text/RCTTextInput.m#L118

Repro

It works on snack because it doesn't have the text input changes yet, the same code doesn't work currently on master.

https://snack.expo.io/HJMHiNaI-

cc @shergin

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions