Close Keyboard on IOS and Android from Angular 4 typescript
up vote
0
down vote
favorite
I am creating an app in angular 4 with typescript. The problem I am facing is I want to close the keyboard in mobile when I am displaying a div at the bottom.
As the div is at bottom it is not visible because of the keyboards. So I want to close the keyboards so user can see the div.
How can this be achieved?
add a comment |
up vote
0
down vote
favorite
I am creating an app in angular 4 with typescript. The problem I am facing is I want to close the keyboard in mobile when I am displaying a div at the bottom.
As the div is at bottom it is not visible because of the keyboards. So I want to close the keyboards so user can see the div.
How can this be achieved?
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am creating an app in angular 4 with typescript. The problem I am facing is I want to close the keyboard in mobile when I am displaying a div at the bottom.
As the div is at bottom it is not visible because of the keyboards. So I want to close the keyboards so user can see the div.
How can this be achieved?
I am creating an app in angular 4 with typescript. The problem I am facing is I want to close the keyboard in mobile when I am displaying a div at the bottom.
As the div is at bottom it is not visible because of the keyboards. So I want to close the keyboards so user can see the div.
How can this be achieved?
edited Nov 8 '17 at 9:12
Cristophs0n
5581822
5581822
asked Nov 7 '17 at 12:42
Abhishek
167
167
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Can you try it?
export class yourComponent ...... {
@ViewChildren('yourTextInput') yourTextInput;
ngAfterViewInit() {
this.yourTextInput.first.nativeElement.blur();
}
}
You should still include the library link in the answer.
– Zoe
Nov 9 at 13:12
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Can you try it?
export class yourComponent ...... {
@ViewChildren('yourTextInput') yourTextInput;
ngAfterViewInit() {
this.yourTextInput.first.nativeElement.blur();
}
}
You should still include the library link in the answer.
– Zoe
Nov 9 at 13:12
add a comment |
up vote
0
down vote
Can you try it?
export class yourComponent ...... {
@ViewChildren('yourTextInput') yourTextInput;
ngAfterViewInit() {
this.yourTextInput.first.nativeElement.blur();
}
}
You should still include the library link in the answer.
– Zoe
Nov 9 at 13:12
add a comment |
up vote
0
down vote
up vote
0
down vote
Can you try it?
export class yourComponent ...... {
@ViewChildren('yourTextInput') yourTextInput;
ngAfterViewInit() {
this.yourTextInput.first.nativeElement.blur();
}
}
Can you try it?
export class yourComponent ...... {
@ViewChildren('yourTextInput') yourTextInput;
ngAfterViewInit() {
this.yourTextInput.first.nativeElement.blur();
}
}
answered Nov 9 at 13:09
sinan kaya
11
11
You should still include the library link in the answer.
– Zoe
Nov 9 at 13:12
add a comment |
You should still include the library link in the answer.
– Zoe
Nov 9 at 13:12
You should still include the library link in the answer.
– Zoe
Nov 9 at 13:12
You should still include the library link in the answer.
– Zoe
Nov 9 at 13:12
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f47158321%2fclose-keyboard-on-ios-and-android-from-angular-4-typescript%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown