From 70afa8c7e2f0cf61dc8c1148f07a1889c21d6457 Mon Sep 17 00:00:00 2001 From: chenos Date: Thu, 24 Nov 2022 15:38:43 +0800 Subject: [PATCH] fix(upload-component): open attachment link in new tab --- .../src/schema-component/antd/upload/ReadPretty.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/upload/ReadPretty.tsx b/packages/core/client/src/schema-component/antd/upload/ReadPretty.tsx index 0f576813a..968cac969 100644 --- a/packages/core/client/src/schema-component/antd/upload/ReadPretty.tsx +++ b/packages/core/client/src/schema-component/antd/upload/ReadPretty.tsx @@ -28,15 +28,16 @@ ReadPretty.Attachment = (props: UploadProps) => {
{images.map((file) => { const handleClick = (e) => { - e.preventDefault(); - e.stopPropagation(); const index = images.indexOf(file); if (isImage(file.extname)) { + e.preventDefault(); + e.stopPropagation(); setVisible(true); setPhotoIndex(index); - } else { - saveAs(file.url, `${file.title}${file.extname}`); } + // else { + // saveAs(file.url, `${file.title}${file.extname}`); + // } }; return (