From f73f3be6bb8d9d177dacad0aba4509d6767bc645 Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Thu, 21 Jul 2022 15:43:20 +0800 Subject: [PATCH] fix(canvas): H5 createNativeEvent handle preventDefault and stopPropagation --- packages/uni-core/src/view/plugin/componentInstance.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/uni-core/src/view/plugin/componentInstance.ts b/packages/uni-core/src/view/plugin/componentInstance.ts index f13d9075a4..fded535a29 100644 --- a/packages/uni-core/src/view/plugin/componentInstance.ts +++ b/packages/uni-core/src/view/plugin/componentInstance.ts @@ -46,7 +46,6 @@ export function $nne( ;(res as any).changedTouches = normalizeTouchEvent(evt.changedTouches, top) } if (__PLATFORM__ === 'h5') { - wrapperEvent(res, evt) return ( wrapperH5WxsEvent( res, @@ -89,6 +88,11 @@ export function createNativeEvent( ;(event as any).touches = (evt as TouchEvent).touches ;(event as any).changedTouches = (evt as TouchEvent).changedTouches } + + if (__PLATFORM__ === 'h5') { + wrapperEvent(event, evt) + } + return event } -- GitLab