ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

bug: input floating label is always floating when using start/end slots

Open rulaman123 opened this issue 1 year ago • 8 comments

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

ion-input with labelPlacement="floating" not working as intended with slotted ion-button inside. The label is fixed on top even with pristine input.

input bug

The label of the first ion-input without slotted button is correct.

Expected Behavior

When ion-input has or loses focus the label should change its position.

Steps to Reproduce

  1. create an ion-input wit labelPlacement="floating"
  2. create an ion-button with slot="end" inside

Code Reproduction URL

No response

Ionic Info

Ionic: Ionic CLI : 7.1.5 Ionic Framework : @ionic/angular 7.6.0 @angular-devkit/build-angular : 16.2.8 @angular-devkit/schematics : 16.2.8 @angular/cli : 16.2.8 @ionic/angular-toolkit : 10.0.0

Capacitor: Capacitor CLI : 5.5.1 @capacitor/android : 5.5.1 @capacitor/core : 5.5.1 @capacitor/ios : 5.5.1

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

System: NodeJS : v20.10.0 npm : 10.2.3 OS : Windows 10

Additional Information

No response

rulaman123 avatar Dec 07 '23 15:12 rulaman123

+1

richardliebmann avatar Apr 19 '24 06:04 richardliebmann

+1

5uper avatar Apr 26 '24 15:04 5uper

+1

Fearcoder avatar May 12 '24 14:05 Fearcoder

+1

hienpvptit avatar May 18 '24 16:05 hienpvptit

Is there someone from the team who is able to look at this issue? The issue persists in ionic 8 when i have my code like this:

<ion-input label="Password" labelPlacement="floating" type="password> 
       <ion-input-password-toggle slot="end"></ion-input-password-toggle>
</ion-input>

Just looked into the code and it seems there is already a TODO for this issue. So it is just a question of when it is done:

https://github.com/ionic-team/ionic-framework/blob/05f857a39c5f9152564559d70ea208fb08683455/core/src/components/input/input.tsx#L718-L721

VerburgtJimmy avatar May 21 '24 11:05 VerburgtJimmy

+1

VerburgtJimmy avatar May 29 '24 07:05 VerburgtJimmy

+1

YounesAmalouSSCA avatar Jul 23 '24 13:07 YounesAmalouSSCA

+1