user3607282 user3607282 - 1 year ago 172
CSS Question

ionic - Adding a button inside a input field

I'm trying to add a button inside an

but wherever I add it inside the
the button does not show on the screen.

What I'm trying to do is to show a button "Forgot" on top of the password field aligned to the right. Refer screen:

enter image description here

This is my HTML,

<ion-list class="au-form" inset padding>
<ion-input type="text" placeholder="Username"></ion-input>
<ion-input type="password" placeholder="Password"></ion-input>
<button clear>Forgot</button>

How do I achieve this layout in Ionic 2?

Answer Source

Fixed in the recent Ionic releases. Adding item-right on the button works.

 <ion-input type="password" placeholder="Password"></ion-input>
 <button clear item-right>Forgot</button>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download