@bezlepkin/nativescript-keyboard-opening
by bezlepkin | v1.0.1
Nativescript keyboard opening manager.
npm i --save @bezlepkin/nativescript-keyboard-opening

@bezlepkin/nativescript-keyboard-opening

A plugin that allows you to track keyboard opening, changing, closing and returns keyboard height.

npm install @bezlepkin/nativescript-keyboard-opening

Usage

import { keyboardOpening } from '@bezlepkin/nativescript-keyboard-opening';

keyboardOpening().on('opened', async (args: any) => {
console.log('The keyboard is opened', args.data.height);
});

keyboardOpening().on('changed', async (args: any) => {
console.log('The keyboard is changed', args.data.height);
});

keyboardOpening().on('closed', async (args: any) => {
console.log('The keyboard is closed');
});

To stop tracking when you switch to another screen, you need to unsubscribe from the actions:

keyboardOpening().off('opened');
keyboardOpening().off('changed');
keyboardOpening().off('closed');

License

Apache License Version 2.0