Port of Ionic's Cordova keyboard plugin (ionic-plugin-keyboard) to http://trigger.io
The ionic-keyboard-forge
module provides functions to make interacting with the keyboard easier, and fires events to indicate that the keyboard will hide/show.
If you like the functionality you can use this plugin without using ionic.
Currently this module has not been approved by Trigger.io. To use it, you need to manage it as a private module:
- Git clone the code
- Add it as a module to your project
- Upload it using the trigger.io interface
- Switch to your main application, include it as a private module with the uploaded version number
forge.ionic_keyboard.hideKeyboardAccessoryBar
forge.ionic_keyboard.close
forge.ionic_keyboard.disableScroll
forge.ionic_keyboard.show
forge.ionic_keyboard.isVisible
These events are fired on the window (the module transparently forwards events sent to forge to window for compatibility with cordova reasons).
- native.keyboardshow
- A number
keyboardHeight
is given on the event object, which is the pixel height of the keyboard.
- A number
- native.keyboardhide
Hide the keyboard accessory bar with the next, previous and done buttons. This offers similar functionality to damn_you_form_assist module
forge.ionic_keyboard.hideKeyboardAccessoryBar(true);
forge.ionic_keyboard.hideKeyboardAccessoryBar(false);
- iOS
Close the keyboard if it is open.
forge.ionic_keyboard.close();
- iOS, Android
Disable native scrolling, useful if you are using JavaScript to scroll
forge.ionic_keyboard.disableScroll(true);
forge.ionic_keyboard.disableScroll(false);
- iOS
Force keyboard to be shown on Android. This typically helps if autofocus on a text element does not pop up the keyboard automatically
forge.ionic_keyboard.show();
Supported Platforms
- Android
This event fires when the keyboard will be shown
window.addEventListener('native.keyboardshow', keyboardShowHandler);
function keyboardShowHandler(e){
alert('Keyboard height is: ' + e.keyboardHeight);
}
keyboardHeight: the height of the keyboard in pixels
- iOS, Android
This event fires when the keyboard will hide
window.addEventListener('native.keyboardhide', keyboardHideHandler);
function keyboardHideHandler(e){
alert('Goodnight, sweet prince');
}
None
- iOS, Android