I have the following code in my Ionic 3 project.
<ion-item>
<ion-icon name="person" item-start></ion-icon>
<ion-label floating>Email</ion-label>
<ion-input type="email" name="email" [(ngModel)]="registerCredentials.email" required></ion-input>
</ion-item>
This gives me the following result.
The icon in outside of the input line. Who to get it inside by keeping my Label floating.
You can fix that by placing the icon inside of the label, like this:
Working plunker
EDIT
In order to prevent that, you can add the following style rule:
That way the icon will be shown only when the label is not floating.
EDIT II
You could add a few style rules to do that. The key would be to place the icon outside the
ion-label
, and set its position to be anabsolute
value. Please take a look at this new updated plunkerThe result would be like this:
html
scss