I want to never allow close the keyboard in my screen so i try to handel this button
Asked
Active
Viewed 126 times
1 Answers
0
The keyboard should open automatically when a <TextField />
is focused. You can use the autoFocus
prop to make it focus when the element mounts link
Also, you can check this answer
How to open keyboard automatically in React Native?
By the way, you want to control the hardware back button for this, to visit this link
React Native - Device back button handling
here is the sample code for hardware back button.
import { BackHandler } from 'react-native';
constructor(props) {
super(props)
this.handleBackButtonClick = this.handleBackButtonClick.bind(this);
}
componentWillMount() {
BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonClick);
}
componentWillUnmount() {
BackHandler.removeEventListener('hardwareBackPress', this.handleBackButtonClick);
}
handleBackButtonClick() {
this.props.navigation.goBack(null);
return true;
}

Asad
- 563
- 3
- 16
-
Thank for you answer but all of these are not my solution ,i want to dont allow user to close the keyboard – Tohid Taghavi Mar 24 '20 at 09:11
-
can you share your code, maybe I can fix it after looking your code – Asad Mar 24 '20 at 09:20