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

Fix keyboard staying as email when switching between default and email #33924

Closed
wants to merge 2 commits into from

Conversation

larkox
Copy link
Contributor

@larkox larkox commented May 27, 2022

Summary

Right now, when we change the keyboardType on android between between default and email, the value keyboard type stays as email (specially noticeable with the key next to the spacebar, that changes between the comma (,) to the at sign (@)).

This is because the mask we are using when updating the input is only taking into account the class, and not the flags nor the variations.

We don't apply all masks because it may interfere with flags assigned by other props, like multiline or secure text entry. Therefore, we have created our own mask, taking into account all the variations and flags that the keyboardType prop may set. This may be hard to maintain, since whenever we add any other keyboard type, we have to take these flags into mind.

The error I was trying to fix was in particular regarding going back and forward from email, but this fix may solve other similar issues with other keyboard styles.

Changelog

[Android] [Fixed] - Fix a bug where the keyboard, once set as email, won't change back to default.

Test Plan

In order to test this PR, any test code with a TextInput, and a way to change the value of the keyboardType should work. We should be able to see how the keyboard changes to the correct type without staying, for example, on the email state.

@facebook-github-bot
Copy link
Contributor

Hi @larkox!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@react-native-bot react-native-bot added Bug Platform: Android Android applications. labels May 27, 2022
@analysis-bot
Copy link

analysis-bot commented May 27, 2022

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 8db2336
Branch: main

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 27, 2022
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label May 27, 2022
@larkox
Copy link
Contributor Author

larkox commented May 31, 2022

Some tests are failing, but looking at the CI seem unrelated to the PR. Not sure if you want me to proceed in any particular way.

@facebook-github-bot
Copy link
Contributor

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

@makovkastar
Copy link
Contributor

Some tests are failing, but looking at the CI seem unrelated to the PR. Not sure if you want me to proceed in any particular way.

Could you rebase this commit past #33930? The test failures you are seeing should be fixed then.

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,788,185 +25
android hermes armeabi-v7a 7,191,771 +29
android hermes x86 8,099,554 +30
android hermes x86_64 8,077,051 +30
android jsc arm64-v8a 9,656,311 +46
android jsc armeabi-v7a 8,428,819 +51
android jsc x86 9,608,486 +51
android jsc x86_64 10,203,035 +42

Base commit: 8db2336
Branch: main

@larkox
Copy link
Contributor Author

larkox commented Jun 1, 2022

@makovkastar Merged and passing the tests

@facebook-github-bot
Copy link
Contributor

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

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @larkox in ec307e0.

When will my fix make it into a release? | Upcoming Releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Platform: Android Android applications. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants