A simple way to dismiss the keyboard programmatically in a react native application. A demo app can be fond here.
- Run
npm install react-native-dismiss-keyboard --save
- Import the library
var dismissKeyboard = require('react-native-dismiss-keyboard');
import dismissKeyboard from 'react-native-dismiss-keyboard';
- Run
dismissKeyboard()
anywhere in your code to close the keyboard.
We currently support react-native >= 0.11
, if you experience any restrictions or if it works below, please let us know.
Please make sure to run the tests before proposing a PR by running npm test
.