Need help upgrading to Ionic Framework 4.0? Get assistance with our Enterprise Migration Services EXPLORE NOW

Keyboard

Improve this doc

Keyboard plugin for Cordova.

Requires Cordova plugin: cordova-plugin-ionic-keyboard. For more info, please see the Keyboard plugin docs.

Repo: https://github.com/ionic-team/cordova-plugin-ionic-keyboard

Installation

  1. Install the Cordova and Ionic Native plugins:
    $ ionic cordova plugin add cordova-plugin-ionic-keyboard
    $ npm install --save @ionic-native/keyboard@4
    
  2. Add this plugin to your app's module

Supported platforms

Usage

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

constructor(private keyboard: Keyboard) { }

...

this.keyboard.show();

this.keyboard.hide();

Instance Members

isVisible

Check keyboard status visible or not.

Returns: boolean

hideFormAccessoryBar(hide)

Hide the keyboard accessory bar with the next, previous and done buttons.

Param Type Details
hide boolean

hide()

Platforms:iOS Android 

Hide the keyboard if shown.

show()

Platforms:Android 

Force keyboard to be shown.

setResizeMode(mode)

Platforms:iOS 

Programmatically set the resize mode

Param Type Details
mode string

onKeyboardShow()

Platforms:iOS Android 

Creates an observable that notifies you when the keyboard is shown. Unsubscribe to observable to cancel event watch.

Returns: Observable<any>

onKeyboardWillShow()

Platforms:iOS Android 

Creates an observable that notifies you when the keyboard will show. Unsubscribe to observable to cancel event watch.

Returns: Observable<any>

onKeyboardHide()

Platforms:iOS Android 

Creates an observable that notifies you when the keyboard is hidden. Unsubscribe to observable to cancel event watch.

Returns: Observable<any>

onKeyboardWillHide()

Platforms:iOS Android 

Creates an observable that notifies you when the keyboard will hide. Unsubscribe to observable to cancel event watch.

Returns: Observable<any>

API

Native

General