Skip to content

Latest commit

 

History

History
40 lines (31 loc) · 1.24 KB

File metadata and controls

40 lines (31 loc) · 1.24 KB

@bezlepkin/nativescript-keyboard-opening

NPM Version NPM Downloads

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