当输入框获取获取焦点后, 再点击其他的子控件中的可点击控件, 不能触发点击事件

当输入框获取获取焦点后, 再点击其他的子控件中的可点击控件, 不能触发点击事件

解决方法, 在 ``, 等内部是虚拟列表的标签上添加属性 keyboardShouldPersistTaps="handled" 可以解决.

官网 https://reactnative.dev/docs/scrollview#keyboardshouldpersisttaps 有说明:

keyboardShouldPersistTaps

Determines when the keyboard should stay visible after a tap.

  • 'never' tapping outside of the focused text input when the keyboard is up dismisses the keyboard. When this happ]ens, 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 children of the scroll view (or captured by an ancestor).
  • false, deprecated, use 'never' instead
  • true, deprecated, use 'always' instead

你可能感兴趣的:(React)