解决TextInput点击输入框外面没有触发onBlur

在大的view外面套一个触发事件

<TouchableWithoutFeedback
  style={{ flex: 1 }}
  onPress={() => {
    this.textInputName.blur();
  }}
>

...

  <TextInput
    ref= {(ref)=>this.textInputName = ref}
  />

...

</TouchableWithoutFeedback>

posted @ 2018-02-06 11:46  喵爷66123  阅读(1310)  评论(0编辑  收藏  举报