Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ public open class ReactTextInputManager public constructor() :
} else if (KEYBOARD_TYPE_VISIBLE_PASSWORD.equals(keyboardType, ignoreCase = true)) {
// This will supersede secureTextEntry={false}. If it doesn't, due to the way
// the flags work out, the underlying field will end up a URI-type field.
flagsToSet = InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
flagsToSet = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
} else if (KEYBOARD_TYPE_URI.equals(keyboardType, ignoreCase = true)) {
flagsToSet = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_URI
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,12 +386,9 @@ class ReactTextInputPropertyTest {

@Test
fun testKeyboardTypeVisiblePassword() {
val passwordVisibilityFlag =
InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD and
InputType.TYPE_TEXT_VARIATION_PASSWORD.inv()

manager.updateProperties(view, buildStyles("keyboardType", "visible-password"))
assertThat(view.inputType and generalKeyboardTypeFlags).isEqualTo(passwordVisibilityFlag)
assertThat(view.inputType and (InputType.TYPE_MASK_CLASS or InputType.TYPE_MASK_VARIATION))
.isEqualTo(InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD)
}

@Test
Expand Down
Loading