@bezlepkin/nativescript-keyboard-opening
Nativescript keyboard opening manager.
npm i --save @bezlepkin/nativescript-keyboard-opening
- Version: 1.0.1
- GitHub: https://github.com/Bezlepkin/nativescript-plugins
- NPM: https://www.npmjs.com/package/%40bezlepkin%2Fnativescript-keyboard-opening
- Downloads:
- Last Day: 0
- Last Week: 0
- Last Month: 0
@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