user3480147
user3480147

Reputation: 41

Disable Keyboard :: TextInput React Native

The below given code is working on first time and on second time click on same text input it is not working ( keyboard opening again ). Because the text input is already focused and i am using custom number buttons for input.

TextInput onFocus={Keyboard.dismiss()}

Any suggestions? Problem in react native.

Upvotes: 2

Views: 5747

Answers (2)

Sjonchhe
Sjonchhe

Reputation: 828

<TextInput showSoftInputOnFocus={false}/>

Use showSoftInputOnFocus. reference

Upvotes: 2

Raj Kumar N
Raj Kumar N

Reputation: 793

use can use onKeyPress event, which gets called on every keypress on the textinput

https://facebook.github.io/react-native/docs/textinput#onkeypress

<TextInput onKeyPress={Keyboard.dismiss()}/>

Upvotes: 0

Related Questions