Skip to content

Commit

Permalink
Submit the text on Accessory Done button clicked.
Browse files Browse the repository at this point in the history
Summary:
At the moment we are having a bug that whenever we hit a "Done" button in an input field, a value is not submitted back, so the users cannot complete their work. Here is an example:

https://pxl.cl/28xFq

To fix it, we call a textInputShouldSubmitOnReturn method on Accessory button click.

Changelog
[IOS][Fixed] - Fix keyboard accessory button not triggering onSubmitEditing

Reviewed By: dmitryrykun

Differential Revision: D38152974

fbshipit-source-id: fc026dffd641966cd3d342d95a56c43c71008036
  • Loading branch information
Oleh Malanchuk authored and facebook-github-bot committed Jul 27, 2022
1 parent 8571451 commit 98d74d6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Libraries/Text/TextInput/RCTBaseTextInputView.m
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,8 @@ - (void)reloadInputViewsIfNecessary

- (void)handleInputAccessoryDoneButton
{
// Ignore the value of whether we submitted; just make sure the submit event is called if necessary.
[self textInputShouldSubmitOnReturn];
if ([self textInputShouldReturn]) {
[self.backedTextInputView endEditing:YES];
}
Expand Down

0 comments on commit 98d74d6

Please sign in to comment.