Ionic v4 - how do I autofocus on a Input?
A more generic solution to do this when and where you want could be:
<ion-input ... #inputId></ion-input>
So with a ViewChild
in your controller you can easily set the focus on:
@ViewChild('inputId', {static: false}) ionInput: { setFocus: () => void; };
...
setFocusOnInput() {
this.ionInput.setFocus();
}
This should work
<ion-input autofocus="true"></ion-input>