TouchableOpacity as Item in ListView only reacts after TextInput has lost focus

做~自己de王妃 提交于 2019-11-29 03:55:03
webwelten

The ScrollView (and legacy ListView) component has a prop keyboardShouldPersistTaps which takes three options:

  • never (the default), tapping outside of the focused text input when the keyboard is up dismisses the keyboard. When this happens, children won't receive the tap.
  • always, the keyboard will not dismiss automatically, and the scroll view will not catch taps, but children of the scroll view can catch taps.
  • handled, the keyboard will not dismiss automatically when the tap was handled by a children, (or captured by an ancestor).

Example

<ScrollView keyboardShouldPersistTaps="always">
  // Your TextInput and Button here…
</ScrollView>

I set this property to true and it works as expected. =)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!