I’m having trouble implementing or finding a solution to one of the most common scenarios in mobile apps: How do I make an <ion-footer>/<ion-toolbar>
with an input (like in a chat app) or a button to “follow” the keyboard when it’s shown/hidden?
When keyboard is hidden, the footer toolbar would be fixed to the bottom of the screen and not move with the scroll (easy - put everything in <ion-footer>
).
When keyboard is shown, it should automatically float right above the keyboard.
Currently <ion-footer>
just always stays at the very bottom of the screen, covered by keyboard.
Is there a built-in or a workaround solution for this?
<ion-content>
<h2 text-center>Just a Test Form</h2>
<form>
<ion-item>
<ion-label stacked>Bill Name</ion-label>
<ion-input [(ngModel)]="name" name="billName" type="text"></ion-input>
</ion-item>
<ion-item>
<ion-label stacked>Amount</ion-label>
<ion-input [(ngModel)]="amount" name="billAmount" type="number"></ion-input>
</ion-item>
<ion-item>
<ion-label>Due Date</ion-label>
<ion-datetime displayFormat="D MMM, YY" name="billDate" pickerFormat="DD MMM YYYY" [(ngModel)]="dueDate"></ion-datetime>
</ion-item>
</form>
</ion-content>
<ion-footer>
<ion-toolbar>
<button ion-button block (click)="createBill()">
Create Bill
</button>
</ion-toolbar>
</ion-footer>
Thank you for any help on this!