From ccf82363263ab7fd76b7dfc5ff370689f923feb9 Mon Sep 17 00:00:00 2001 From: emiyaaaaa Date: Wed, 15 Apr 2026 16:03:29 +0800 Subject: [PATCH 1/3] fix: add motionDeadline to to fix the preview not be removed when the preview closed immediately after opening --- src/Preview/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Preview/index.tsx b/src/Preview/index.tsx index 8c48296..8a72f2a 100644 --- a/src/Preview/index.tsx +++ b/src/Preview/index.tsx @@ -428,6 +428,7 @@ const Preview: React.FC = props => { motionAppear motionEnter motionLeave + motionDeadline={500} onVisibleChanged={onVisibleChanged} > {({ className: motionClassName, style: motionStyle }) => { From 95547260d481c32f2ac5e9f8beff2fe0303dbefd Mon Sep 17 00:00:00 2001 From: Haozheng Li <2914034404@qq.com> Date: Wed, 15 Apr 2026 16:46:10 +0800 Subject: [PATCH 2/3] Update src/Preview/index.tsx Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- src/Preview/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Preview/index.tsx b/src/Preview/index.tsx index 8a72f2a..1bded19 100644 --- a/src/Preview/index.tsx +++ b/src/Preview/index.tsx @@ -428,7 +428,7 @@ const Preview: React.FC = props => { motionAppear motionEnter motionLeave - motionDeadline={500} + motionDeadline={1000} onVisibleChanged={onVisibleChanged} > {({ className: motionClassName, style: motionStyle }) => { From fd93561ea6978b12ea9aed69a630cf30e9c35844 Mon Sep 17 00:00:00 2001 From: emiyaaaaa Date: Wed, 15 Apr 2026 16:59:23 +0800 Subject: [PATCH 3/3] feat: add pass-through class --- assets/preview.less | 10 ++++++++++ src/Preview/index.tsx | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/assets/preview.less b/assets/preview.less index 0882b33..33e480a 100644 --- a/assets/preview.less +++ b/assets/preview.less @@ -7,6 +7,16 @@ inset: 0; z-index: 1055; + &-pass-through { + pointer-events: none; + + *, + *::before, + *::after { + pointer-events: none !important; + } + } + &-mask { position: absolute; background-color: rgba(0, 0, 0, 0.3); diff --git a/src/Preview/index.tsx b/src/Preview/index.tsx index 8a72f2a..9841ccf 100644 --- a/src/Preview/index.tsx +++ b/src/Preview/index.tsx @@ -428,7 +428,7 @@ const Preview: React.FC = props => { motionAppear motionEnter motionLeave - motionDeadline={500} + motionDeadline={1000} onVisibleChanged={onVisibleChanged} > {({ className: motionClassName, style: motionStyle }) => { @@ -447,6 +447,7 @@ const Preview: React.FC = props => { className={clsx(prefixCls, rootClassName, classNames.root, motionClassName, { [`${prefixCls}-movable`]: movable, [`${prefixCls}-moving`]: isMoving, + [`${prefixCls}-pass-through`]: !(portalRender && open), })} style={mergedStyle} role="dialog"