-2

I want to never allow close the keyboard in my screen so i try to handel this button

enter image description here

1 Answers1

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