Ionic Keyboard Plugin for Cordova
Objective-C Java JavaScript
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 32 commits ahead, 137 commits behind ionic-team:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
www
.gitignore
LICENSE
README.md
package.json
plugin.xml

README.md

Keyboard

The Keyboard object on the cordova.plugins object provides functions to make interacting with the keyboard easier, and fires events to indicate that the keyboard will hide/show.

cordova plugin add https://github.com/driftyco/ionic-plugins-keyboard.git

Methods

  • cordova.plugins.Keyboard.hideKeyboardAccessoryBar
  • cordova.plugins.Keyboard.close
  • cordova.plugins.Keyboard.disableScroll

Properties

  • cordova.plugins.Keyboard.isVisible

Events

  • native.showkeyboard
  • native.hidekeyboard

Permissions

config.xml

        <feature name="Keyboard">
            <param name="ios-package" value="IonicKeyboard" onload="true" />
        </feature>

Keyboard.hideKeyboardAccessoryBar

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

cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(false);

Supported Platforms

  • iOS

Keyboard.close

Close the keyboard if it is open.

cordova.plugins.Keyboard.close();

Supported Platforms

  • iOS

Keyboard.disableScroll

Disable native scrolling, useful if you are using JavaScript to scroll

cordova.plugins.Keyboard.disableScroll();

Supported Platforms

  • iOS

native.showkeyboard

This event fires when the keyboard will be shown

window.addEventListener('native.showkeyboard', keyboardShowHandler);

function keyboardShowHandler(e){
    alert('Keyboard height is: ' + e.keyboardHeight);
}

Properties

keyboardHeight: the height of the keyboard in pixels

Supported Platforms

  • iOS, Android

native.hidekeyboard

This event fires when the keyboard will hide

window.addEventListener('native.hidekeyboard', keyboardHideHandler);

function keyboardHideHandler(e){
    alert('Goodnight, sweet prince');
}

Properties

None

Supported Platforms

  • iOS, Android