8000 bug: IonInput type="password" clears input field on modifier key press · Issue #28633 · ionic-team/ionic-framework · GitHub
[go: up one dir, main page]

Skip to content
bug: IonInput type="password" clears input field on modifier key press  #28633
@chawes13

Description

@chawes13

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

When IonInput is given a value of type="password" in @ionic/react, the input will clear text unexpectedly when certain keys are pressed. This is most notable when using a keyboard to navigate between controls. This behavior is not observed with the native input element with type set to password or the default IonInput.

Expected Behavior

IonInputs should be accessible via keyboard. Pressing modifier keys (e.g., shift, command) should not clear a password input (unless combined with another key, e.g., shift + p).

Steps to Reproduce

  1. Create an IonInput with type="password"
  2. Enter a value (either via keyboard or via password manager autofill)
  3. Tab to the next focusable element
  4. Tab back to the password input
  5. Tab to the next focusable element
  6. IonInput with type="password" is empty

Code Reproduction URL

https://stackblitz.com/edit/vxete3-yk4b3w?file=src%2Fmain.tsx

Ionic Info

Via StackBlitz:

Ionic:

Ionic CLI : 5.4.16

Utility:

cordova-res : not installed
native-run : not installed

System:

NodeJS : v18.18.0
npm : 9.4.2
OS : Linux 5.0

Additional Information

First noticed on a project using @ionic/react: 7.0.4 and validated on latest available release in StackBlitz (i.e., "@ionic/react": "^7.5.7" and "@ionic/react-router": "^7.5.7").

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0