A NativeScript plugin to deal knowing if the keyboard is showing or hiding.
This is an updated fork to work with NativeScript 6.
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 the original author at http://nativescript.tools.
npm install dosomder/nativescript-keyboardshowing#master
import keyboard from "nativescript-keyboardshowing";
Register a handler when keyboard showing changes:
keyboard.addNotifyKeyboardAction(showing => {
console.log("keyboardshowing: ", showing.showing);
});
Sometimes if the page changes (e.g. component is removed), keyboard tracking might get lost on Android. To fix this you can call:
keyboard.refreshListener();
If you keep losing tracking, you can put it in an interval:
setInterval(keyboard.refreshListener, 1000);
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.
import keyboard from "nativescript-keyboardshowing";
import keyboard from "nativescript-keyboardshowing";
console.log("keyboard is", keyboard.isShowing() ? "showing" : "hidden");