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 8c48296..9841ccf 100644 --- a/src/Preview/index.tsx +++ b/src/Preview/index.tsx @@ -428,6 +428,7 @@ const Preview: React.FC = props => { motionAppear motionEnter motionLeave + motionDeadline={1000} onVisibleChanged={onVisibleChanged} > {({ className: motionClassName, style: motionStyle }) => { @@ -446,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"