Skip to content

Changing TextInput keyboardType from visible-password does not unset the underlying flags (Android) #17248

Closed

Description

@BrandonWilliamsCS

Is this a bug report?

Yes.

Have you read the Contributing Guidelines?

Yes.

Environment

Environment:
OS: macOS High Sierra 10.13.2
Node: 9.2.0
Yarn: 1.3.2
npm: 5.5.1
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
react: 16.0.0 => 16.0.0
react-native: facebook/react-native#master => 1000.0.0
(react-native built from master branch on 2017-12-17)

Target Platform: Android 8.x
Tested specifically on Nexus 5x, api level 27

Steps to Reproduce

  1. Create a TextInput with secureTextEntry set and a keyboardType of null, undefined, or 'default'
  2. Change the keyboardType to 'visible-password'
  3. Change the keyboardType back to 'default'

Expected Behavior

The field would initially be an obscured password field, then become unobscured, then become obscured again when no longer of type 'visible-password'.
Additionally, the soft keyboard variant stays in "password" mode (e.g., no suggestions) in each case due to secureTextEntry.

Actual Behavior

After set to 'visible-password', the field remains unobscured even after switching to a different type.
However, when not obscured, the soft keyboard falls returns to a plain text keyboard with suggestions instead of numbers on the top row (may vary by device).

Reproducible Demo

I believe this branch should exhibit the bug out-of-the-box (after installing packages and building):
https://github.com/BrandonWilliamsCS/react-native-test-harness/tree/fix/android-textfield-keyboardtype-flags

Once running on an Android device or emulator, tap the field so that the soft keyboard appears and enter text into the field. This will trigger a state change that toggles between 'visible-password' and 'default'.

Activity

  1. stale commented on Feb 15, 2018

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

  2. added
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on Feb 15, 2018
  3. hanspoo commented on Apr 9, 2018

    @hanspoo

    Same problem here with:

    "react": "16.3.0-alpha.1",
    "react-native": "0.54.0"
    

    The use of a keyboardType email-address disables secureTextEntry.

  4. locked and limited conversation to collaborators on May 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions