Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to hide keyboard when focusing an ion-input?

I wanted to have an ion-input that will be focused and the keyboard should not appear. Is there any way or is it possible? Thank you!

like image 203
Ace Avatar asked Aug 20 '18 08:08

Ace


1 Answers

yes, install this plugin -> https://ionicframework.com/docs/native/keyboard/

html

<ion-input type="text" [(ngModel)]="message"  (ionFocus)="keyboard_show()"  #input ></ion-input>

ts

    import {
      Keyboard
    } from '@ionic-native/keyboard';

    constructor(private keyboard: Keyboard, private ) {
    }
      keyboard_show(){
       this.keyboard.close();
      }
like image 133
Kevin Dias Avatar answered Sep 19 '22 23:09

Kevin Dias