From b51a7297a4baf1f6dc72ea248428ef23720b45b9 Mon Sep 17 00:00:00 2001 From: lareinayanyu Date: Mon, 23 Dec 2024 17:15:15 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BA=8B=E4=BB=B6=E9=92=A9=E5=AD=90?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E4=B8=8D=E7=A8=B3=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/runtime/components/react/getInnerListeners.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/webpack-plugin/lib/runtime/components/react/getInnerListeners.ts b/packages/webpack-plugin/lib/runtime/components/react/getInnerListeners.ts index 4a8b5c067..2bd4da644 100644 --- a/packages/webpack-plugin/lib/runtime/components/react/getInnerListeners.ts +++ b/packages/webpack-plugin/lib/runtime/components/react/getInnerListeners.ts @@ -317,11 +317,10 @@ const useInnerProps = ( } } - if (!rawEventKeys.length || config.disableTouch) { - return omit(propsRef.current, removeProps) - } - const events = useMemo(() => { + if (!rawEventKeys.length || config.disableTouch) { + return {} + } const transformedEventKeys = rawEventKeys.reduce((acc: string[], key) => { if (propsRef.current[key]) { return acc.concat(eventConfig[key]) @@ -339,7 +338,7 @@ const useInnerProps = ( }) return events - }, [hashEventKey]) + }, [hashEventKey, config.disableTouch]) return extendObject( {}, From 06dfc2f17238195c214b29abc9630d13298338d8 Mon Sep 17 00:00:00 2001 From: lareinayanyu Date: Mon, 23 Dec 2024 19:30:34 +0800 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20=E4=B8=8B=E7=BA=BFdisableTouch?= =?UTF-8?q?=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/runtime/components/react/getInnerListeners.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/webpack-plugin/lib/runtime/components/react/getInnerListeners.ts b/packages/webpack-plugin/lib/runtime/components/react/getInnerListeners.ts index 2bd4da644..10f0ae130 100644 --- a/packages/webpack-plugin/lib/runtime/components/react/getInnerListeners.ts +++ b/packages/webpack-plugin/lib/runtime/components/react/getInnerListeners.ts @@ -289,7 +289,6 @@ const useInnerProps = ( const eventConfig: { [key: string]: string[] } = {} const config = rawConfig || { layoutRef: { current: {} }, - disableTouch: false, disableTap: false } const removeProps = [ @@ -318,7 +317,7 @@ const useInnerProps = ( } const events = useMemo(() => { - if (!rawEventKeys.length || config.disableTouch) { + if (!rawEventKeys.length) { return {} } const transformedEventKeys = rawEventKeys.reduce((acc: string[], key) => { @@ -338,7 +337,7 @@ const useInnerProps = ( }) return events - }, [hashEventKey, config.disableTouch]) + }, [hashEventKey]) return extendObject( {},