0

I am using React Native and TextInput component to search products. When tapping on the input, keyboard opens, I write something and then press submit. Keyboard closes. I want it to stay open until i explicitly tell it to close so a user could keep searching and adding products to the list. Something similar to an iOS Notes app.

Everything related to this topic I was able to find talked about having some scrollable view be the problem, but my input in the screen header is wrapped with regular View. I even tried wrapping the input component with ScrollableView to try the keyboardShouldPersistTaps="handled" but this didn't work either.

Currently the only way i got this to work was to add a timeout to a function that focuses on the input after submitting, but this makes the keyboard dismiss and reappear.

How can I keep the keyboard open until the user decides to dismiss it?

1 Answers1

0

Have you tried setting blur on submit to false? https://reactnative.dev/docs/textinput#bluronsubmit

Roberto Yoc
  • 461
  • 2
  • 7
  • Thanks, i tried this before but it turned out that there was another component closing the keyboard that i totally missed and that's why i discarded this method. Disabling that component your solution worked. Thank you for your help! – FreshOldDeveloper May 24 '23 at 13:47