React-native: moving focus into TextInput prevents button presses

Created on 15 Aug 2016  路  8Comments  路  Source: facebook/react-native

If my code moves focus to a particular TextInput and I press a "button" (TouchableOpacity), the first press doesn't work. I guess that just moves focus out of the TextInput. Then the next press works. This doesn't seem like the expected behavior.

Locked

Most helpful comment

8234 solves my problem

set keyboardShouldPersistTaps of ScrollView to true

All 8 comments

This same problem was brought up here, and they didn't actually find a solution to the actual problem, so I'm interested in an answer to this as well. https://github.com/facebook/react-native/issues/4229

8234 solves my problem

set keyboardShouldPersistTaps of ScrollView to true

A TextInput with some related buttons and a list ,#8234 cannot help, especially when callback function of TextInput鈥榝ocus event make the list showed

Many scenarios where this behavior would be desirable, such as a login form, are not in a scroll view

+1

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

Setting contentProps={{keyboardDismissMode: 'interactive', keyboardShouldPersistTaps: 'handled'}} on the parent ScrollView fixes it for me. Got this from #4229 thanks to @antonKalinin.

In places such as LoginScreen or simple TextInput with TouchableOpacity, it still requires double tap(iOS) to call the function. anyone found any work around other than ScrollView or ListView ?

Was this page helpful?
0 / 5 - 0 ratings