How do I keep/blur TextInput keyboard on React Native

How do I keep/blur TextInput keyboard on React Native

I tap on textinput and the keyboard slide from the bottom, how do I slides it back down or keep/blur the keyboard on react native?

Solutions/Answers:

Answer 1:

https://github.com/facebook/react-native/blob/master/Libraries/Utilities/dismissKeyboard.js

var dismissKeyboard = require('dismissKeyboard')

onPressCancelButton {
    dismissKeyboard();
}

Answer 2:

Use iqkeyboardManager best for hide keyboard with done button toolbar

Link: https://github.com/hackiftekhar/IQKeyboardManager

Answer 3:

You can use Keyboard module from react-native.

https://facebook.github.io/react-native/docs/keyboard

import { Keyboard } from react-native;

Keyboard.dismiss();

Answer 4:

This is the default behavior right now. Show onFocus and hide onBlur. So no need for an extra library anymore.

References

Loading...