nativescript-keyboardShowing
A NativeScript plugin to deal knowing if the keyboard is showing or hiding.
License
This is released under the MIT License, meaning you are free to include this in any type of program -- However for entities that need a support contract, changes, enhancements and/or a commercial license please contact me at http://nativescript.tools.
Sample Snapshot
Installation
tns plugin add nativescript-keyboardshowing
Usage
To use the module you just require()
it:
var keyboard = require( "nativescript-keyboardshowing" );
console.log("keyboard is", keyboard.isShowing() ? "showing" : "hidden");
exports.onKeyboard = function (evt) {
console.log("Keyboard is now", evt.showing ? 'showing' : 'hidden');
};
You ask, how exactly does this help?
Have you ever needed to know if the Soft-keyboard is showing? This plugin gives you that information via a event or a function call.
You can add to any page you need it the following Function:
exports.onKeyboard = function(args) { }
args.showing = true | false
args.object = the current page
Additional Helper Method
var keyboard = require('nativescript-keyboardshowing');
keyboard.isShowing()
returns: true or false
var keyboard = require( "nativescript-keyboardshowing" );
console.log("keyboard is", keyboard.isShowing() ? "showing" : "hidden");