From 06e5e42ef13ec70e3d65477993b9f3517f26550c Mon Sep 17 00:00:00 2001 From: huxiyang <1872591453@qq.com> Date: Fri, 24 May 2024 14:32:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(imagePreview):=20=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=8D=A2=E9=A1=B5=E6=97=A0=E6=B3=95=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/packages/imagepreview/imagepreview.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/packages/imagepreview/imagepreview.tsx b/src/packages/imagepreview/imagepreview.tsx index 9b1b97277d..6a27c7447f 100644 --- a/src/packages/imagepreview/imagepreview.tsx +++ b/src/packages/imagepreview/imagepreview.tsx @@ -242,6 +242,7 @@ export const ImagePreview: FunctionComponent> = ( } const onCloseInner = (e: React.MouseEvent) => { + console.log('onCloseInner') e.stopPropagation() setShowPop(false) setActive(innerNo) @@ -254,6 +255,8 @@ export const ImagePreview: FunctionComponent> = ( } const closeOnImg = (e: React.MouseEvent) => { + console.log('closeOnImg') + e.stopPropagation() // 点击内容区域的图片是否可以关闭弹层(视频区域由于nut-video做了限制,无法关闭弹层) if (closeOnContentClick) { onCloseInner(e) From c8920db48e83e9383c678c4a7385d103124435e7 Mon Sep 17 00:00:00 2001 From: huxiyang <1872591453@qq.com> Date: Fri, 24 May 2024 14:38:00 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(imagePreview):=20=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=8D=A2=E9=A1=B5=E6=97=A0=E6=B3=95=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/packages/imagepreview/imagepreview.taro.tsx | 1 + src/packages/imagepreview/imagepreview.tsx | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/packages/imagepreview/imagepreview.taro.tsx b/src/packages/imagepreview/imagepreview.taro.tsx index 72b017840b..973a5e59ee 100644 --- a/src/packages/imagepreview/imagepreview.taro.tsx +++ b/src/packages/imagepreview/imagepreview.taro.tsx @@ -256,6 +256,7 @@ export const ImagePreview: FunctionComponent> = ( } const closeOnImg = (e: ITouchEvent | React.MouseEvent) => { // 点击内容区域的图片是否可以关闭弹层(视频区域由于nut-video做了限制,无法关闭弹层) + e.stopPropagation() if (closeOnContentClick) { onCloseInner(e) } diff --git a/src/packages/imagepreview/imagepreview.tsx b/src/packages/imagepreview/imagepreview.tsx index 6a27c7447f..a260b97e69 100644 --- a/src/packages/imagepreview/imagepreview.tsx +++ b/src/packages/imagepreview/imagepreview.tsx @@ -242,7 +242,6 @@ export const ImagePreview: FunctionComponent> = ( } const onCloseInner = (e: React.MouseEvent) => { - console.log('onCloseInner') e.stopPropagation() setShowPop(false) setActive(innerNo) @@ -255,7 +254,6 @@ export const ImagePreview: FunctionComponent> = ( } const closeOnImg = (e: React.MouseEvent) => { - console.log('closeOnImg') e.stopPropagation() // 点击内容区域的图片是否可以关闭弹层(视频区域由于nut-video做了限制,无法关闭弹层) if (closeOnContentClick) {