Repository navigation
Fix Android visible-password keyboard input type - #59013
Open
YevheniiKotyrlo wants to merge 1 commit into
Open
YevheniiKotyrlo wants to merge 1 commit into
YevheniiKotyrlo wants to merge 1 commit into
Conversation
keyboardType="visible-password" sets TYPE_TEXT_VARIATION_VISIBLE_PASSWORD with no input class, and setKeyboardType applies its flags with TYPE_MASK_CLASS as the mask to clear, so the field is committed with class TYPE_NULL, which Android documents as not editable. The url arm had the same omission until react#58505; this gives visible-password the TYPE_CLASS_TEXT the email-address and url arms already set. The test masked its reading with generalKeyboardTypeFlags, which excludes TYPE_TEXT_VARIATION_PASSWORD, so it compared 0x10 and passed with the class missing. It now asserts the class and the variation exactly.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
keyboardType="visible-password"reaches Android with no input class.setKeyboardTypeappliesflagsToSetwithTYPE_MASK_CLASSas the mask to clear, and that arm sets onlyTYPE_TEXT_VARIATION_VISIBLE_PASSWORD(0x90), so the input method receives classTYPE_NULL, whichInputTypedefines as a connection that cannot show candidate text or retrieve the current text. #58505 fixed the same omission in theurlarm; this givesvisible-passwordtheTYPE_CLASS_TEXTtheemail-addressandurlarms already set.testKeyboardTypeVisiblePasswordcould not see it:generalKeyboardTypeFlagsmasks outTYPE_TEXT_VARIATION_PASSWORD, so the test compared0x10and passed with the class missing. It now asserts the class and the variation exactly.Changelog:
[ANDROID] [FIXED] - Restore the text input class for visible-password keyboard types
Test Plan:
./gradlew :packages:react-native:ReactAndroid:testDebugUnitTest --tests "com.facebook.react.views.textinput.ReactTextInputPropertyTest" -Preact.internal.useHermesStable=true: onmainthe updated test fails withexpected:<145> but was:<144>(0x91against0x90); with the fix all 28 tests in the class pass../gradlew :packages:react-native:ReactAndroid:testDebugUnitTest -PenableWarningsAsErrors=true -Preact.internal.useHermesStable=true: 674 tests, 0 failures.node ./scripts/format-kotlin.js --checkpasses.build_android).