我正在尝试为我的React-Native表单中的双击<ScrollView>
issue创建一个work-arround。
该线程的答案之一非常接近,它使用以下代码:
<ScrollView
showsVerticalScrollIndicator={true}
automaticallyAdjustContentInsets={false}
contentContainerStyle={styles.content}
keyboardDismissMode='on-drag'
keyboardShouldPersistTaps={true}>
<View
onStartShouldSetResponderCapture={(e) => {
const focusField = TextInputState.currentlyFocusedField();
if (focusField != null && e.nativeEvent.target != focusField){
dismissKeyboard();
}
}}>
...
</View>
</ScrollView>
如果你没有点按当前选中的TextInput
,这会取消键盘,如果e.nativeEvent.target
不是TextInput
,我想将其更改为仅关闭键盘点击其他输入时关闭并重新打开键盘。但是,e.nativeEvent.target
是一个数字。
如何从此句柄中获取节点类型?
由于