Commit 06f6596f by zeven

优化是否回车触发的触摸事件判断

parent 631f8cf2
......@@ -32,7 +32,12 @@ export default class PlatformTouchable extends React.Component {
static canUseNativeForeground = TouchableComponent.canUseNativeForeground;
onPress = e => {
if (e.constructor.name === 'SyntheticEvent') {
// 判断是否回车触发的触摸事件
if (
e.constructor.name === 'SyntheticEvent' ||
!e.nativeEvent ||
!e.nativeEvent.locationX
) {
EnterEvent.emit('Trigger');
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment