A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
51.12k
stars
13.5k
forks
source link
bug: ion-input-password-toggle causes layout shift when ion-input has disabled or readonly property #29562
Open
piotr-cz opened 6 months ago
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
orreadonly
propertyAffect is particularly visible when ion-input has
labelPlacement="stacked"
Expected Behavior
Layout should not shift
Steps to Reproduce
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 byvisibility: hidden
instead here:https://github.com/ionic-team/ionic-framework/blob/f238b4258ca5152c2fa13d76deebd5738fd33bda/core/src/components/input/input.scss#L609-L616