Skip to content

Fix Android visible-password keyboard input type - #59013

Open
YevheniiKotyrlo wants to merge 1 commit into
react:mainfrom
YevheniiKotyrlo:fix/android-visible-password-input-class
Open

YevheniiKotyrlo wants to merge 1 commit into
react:mainfrom
YevheniiKotyrlo:fix/android-visible-password-input-class

Conversation

@YevheniiKotyrlo

Copy link
Copy Markdown
Contributor

Summary:

keyboardType="visible-password" reaches Android with no input class. setKeyboardType applies flagsToSet with TYPE_MASK_CLASS as the mask to clear, and that arm sets only TYPE_TEXT_VARIATION_VISIBLE_PASSWORD (0x90), so the input method receives class TYPE_NULL, which InputType defines as a connection that cannot show candidate text or retrieve the current text. #58505 fixed the same omission in the url arm; this gives visible-password the TYPE_CLASS_TEXT the email-address and url arms already set.

testKeyboardTypeVisiblePassword could not see it: generalKeyboardTypeFlags masks out TYPE_TEXT_VARIATION_PASSWORD, so the test compared 0x10 and 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: on main the updated test fails with expected:<145> but was:<144> (0x91 against 0x90); 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 --check passes.
  • Not run: the RNTester build and Android lint (build_android).

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.
@meta-cla meta-cla 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 Oct 12, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Oct 12, 2026

This branch has not been deployed

No deployments
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. 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.

1 participant