Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] Fix TextInput numeric keyboard submit #15438

Closed
wants to merge 1 commit into from

Conversation

gontovnik
Copy link
Contributor

When you have a numeric non-multiline TextInput and a returnKeyType is done we automatically add an input accessory view (implementation).

That view has a done button which triggers handleInputAccessoryDoneButton which currently directly sends endEditing: to the text field / text view. As a consequence, the textInputShouldReturn is not called and we dismiss the keyboard even if the blurOnSubmit value is false.

Test Plan

Confirm that the keyboard is not dismissed when you tap on Done button on this TextInput:

<TextInput
  keyboardType={'numeric'}
  returnKeyType={'done'}
  blurOnSubmit={false}
/>

and that the keyboard is dismissed for this TextInput:

<TextInput
  keyboardType={'numeric'}
  returnKeyType={'done'}
  blurOnSubmit
/>

@gontovnik gontovnik requested a review from shergin as a code owner August 9, 2017 20:54
@facebook-github-bot facebook-github-bot added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Aug 9, 2017
@pull-bot
Copy link

pull-bot commented Aug 9, 2017

Attention: @shergin

Generated by 🚫 dangerJS

@janicduplessis janicduplessis added the Platform: iOS iOS applications. label Aug 9, 2017
@shergin
Copy link
Contributor

shergin commented Aug 10, 2017

@gontovnik Just curious, what the point to have a Done button which does nothing?

@gontovnik
Copy link
Contributor Author

@shergin, for my specific case, when user presses Done I do some loading and data validation, but I do not want to automatically dismiss the keyboard and then focus on the field again if the entered data is incorrect.

I do not see the reason why the behavior of blurOnSubmit should be different for the numeric and non-numeric keyboard.

@facebook-github-bot facebook-github-bot added GH Review: accepted Import Started This pull request has been imported. This does not imply the PR has been approved. and removed GH Review: review-needed labels Aug 10, 2017
@facebook-github-bot
Copy link
Contributor

@javache has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@shergin
Copy link
Contributor

shergin commented Aug 10, 2017

@gontovnik Yes, I absolutely agree with thesis that "Done" button above numeric pad must work same way as "Done" key in regular keyboard. (And it must generate same set of events.)
So, with this diff, in your case, you are able receive a some event, right? Which one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Import Started This pull request has been imported. This does not imply the PR has been approved. Platform: iOS iOS applications.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants