Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: ion-input-password-toggle causes layout shift when ion-input has disabled or readonly property #29562

Open
3 tasks done
piotr-cz opened this issue May 29, 2024 · 1 comment
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@piotr-cz
Copy link

piotr-cz commented May 29, 2024

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

The ion-input-password-toggle component causes layout shifts when it's parent ion-input has a disabled or readonly property

Affect is particularly visible when ion-input has labelPlacement="stacked"

Expected Behavior

Layout should not shift

Steps to Reproduce

  1. Go to Code Reproduction URL
  2. Click on Submit
  3. Observe layout shift

Code Reproduction URL

https://stackblitz.com/edit/waav8e?file=src%2Fmain.tsx

Ionic Info

Ionic:

Ionic CLI : 7.2.0

Utility:

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

System:

NodeJS : v18.18.2
npm : 9.8.1
OS : Windows 10

Additional Information

Issue is caused because the ion-input-password-toggle component is larger than ion-input

The display: none css property may be replaced by visibility: hidden instead here:

/**
* The input password toggle component should be hidden when the input is readonly/disabled
* because it is not possible to edit a password.
*/
:host([disabled]) ::slotted(ion-input-password-toggle),
:host([readonly]) ::slotted(ion-input-password-toggle) {
display: none;
}

@ErikOnBike
Copy link

ErikOnBike commented Oct 18, 2024

Bummer....I accidentally assigned the wrong issue number. Closed the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants