Created
May 27, 2018 00:54
-
-
Save dayaki/619a171ea964dac188887e3778b97511 to your computer and use it in GitHub Desktop.
Set input autofocus on ionic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*imports | |
import { Component, ViewChild } from '@angular/core'; | |
@ViewChild('focusInput') myInput; | |
*html | |
<ion-textarea #focusInput></ion-textarea> | |
ionViewDidEnter() { | |
setTimeout(() => { | |
this.keyboard.show(); | |
this.myInput.setFocus(); | |
}, 150); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment