UNPKG

react-native-dismiss-keyboard

Version:

A simple way to dismiss the keyboard programmatically in a react native application.

25 lines (16 loc) 1.28 kB
## react-native-dismiss-keyboard ![CircleCi](https://circleci.com/gh/DanielMSchmidt/react-native-dismiss-keyboard.png?circle-token=905f7ed099611e3f8079a5bf72674beab5e55e50) [![npm version](https://badge.fury.io/js/react-native-dismiss-keyboard.svg)](https://badge.fury.io/js/react-native-dismiss-keyboard) A simple way to dismiss the keyboard programmatically in a react native application. [A demo app can be found here](https://github.com/DanielMSchmidt/DismissKeyboardExample). ## Add it to your project 1. Run `npm install react-native-dismiss-keyboard --save` 2. Import the library - `var dismissKeyboard = require('react-native-dismiss-keyboard');` - `import dismissKeyboard from 'react-native-dismiss-keyboard';` 3. Run `dismissKeyboard()` anywhere in your code to close the keyboard. ## Support | React Native Version | react-native-dismiss-keyboard Version | |---------------------------|---------------------------------------| | >= 11 & < 23 | < 1.0 | | >= 23 | >= 1.0 | If you experience any restrictions or if it works on other versions, please let us know. ## Contribution Please make sure to run the tests before proposing a PR by running `npm test`.