Repository navigation
Commit f99303c
Fix Android visible-password keyboard input type (#59013)
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
Pull Request resolved: #59013
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`).
Reviewed By: cortinico
Differential Revision: D124966195
Pulled By: javache
fbshipit-source-id: 64161cb4c2a41a044a215aa9fcb1a163de9876e61 parent 9979e14 commit f99303c
2 files changed
Lines changed: 3 additions & 6 deletions
File tree
- packages/react-native/ReactAndroid/src
- main/java/com/facebook/react/views/textinput
- test/java/com/facebook/react/views/textinput
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
758 | 758 | | |
759 | 759 | | |
760 | 760 | | |
761 | | - | |
| 761 | + | |
762 | 762 | | |
763 | 763 | | |
764 | 764 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | 389 | | |
394 | | - | |
| 390 | + | |
| 391 | + | |
395 | 392 | | |
396 | 393 | | |
397 | 394 | | |
| |||
0 commit comments