Keyboard

Improve this doc

The Keyboard class allows you to work with the keyboard events provided by the Ionic keyboard plugin.

Usage

export class MyClass{
 constructor(keyboard: Keyboard){
   this.keyboard = keyboard;
 }
}

Instance Members

isOpen()

Chech to see if the keyboard is open or not.

export class MyClass{
 constructor(keyboard: Keyboard){
   this.keyboard = keyboard;
 }
 keyboardCheck(){
   setTimeout(()  => console.log('is the keyboard open ', this.keyboard.isOpen()));
 }
}

Returns: boolean

returns a true or flase value if the keyboard is open or not

onClose(callback)

When the keyboard is closed, call any methods you want

export class MyClass{
 constructor(keyboard: Keyboard){
   this.keyboard = keyboard;
   this.keyboard.onClose(this.closeCallback);
 }
 closeCallback(){
    // call what ever functionality you want on keyboard close
    console.log('Closing time');
 }
}

Param Type Details
callback function

method you want to call when the keyboard has been closed

Returns: function

returns a callback that gets fired when the keyboard is closed

close()

Progamatically close they keyboard

API

Native

General