2

I'm trying to use a barcode reader in my app so I can fill a TextInput within using software keyboard.

The idea is to use something like this:

<TextInput
    autoFocus={true}
    onFocus={Keyboard.dismiss}
    multiline={false}
    onSubmitEditing={() => this.submitFunction()}
/>

It partialy works as I want, I can read the code and It's shown properly but onSubmitEditing is not called.

Does anyone knows how to hide keyboard on a TextView but mantain the focus so onSubmitEditing is called?

If keyboard isn't dismissed onSubmitEditing run as spected.

termitavee
  • 157
  • 2
  • 11
  • It's not normal that Android's Keyboard isn't dismissed when you have a barcode reader connected. Did you test it in a phone? – roadev Jul 19 '17 at 13:12
  • 1
    Now we can hide the keyboard without losing focus https://stackoverflow.com/questions/59639041/react-native-textinput-with-focus-but-without-keyboard-showing – FLash Feb 11 '20 at 11:05

0 Answers0