Skip to content

Commit 7ef9fcc

Browse files
committed
fix(Image): Image mask fade enter blur transition does not work
1 parent 7150f88 commit 7ef9fcc

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

src/Preview/index.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -393,12 +393,20 @@ const Preview: React.FC<PreviewProps> = props => {
393393
className={clsx(prefixCls, rootClassName, classNames.root, { [`${prefixCls}-moving`]: isMoving })}
394394
style={{ ...styles.root, ...(zIndex ? { zIndex } : {}) }}>
395395
{/* Mask */}
396-
{open && (<div
397-
className={clsx(`${prefixCls}-mask`, classNames.mask)}
398-
style={styles.mask}
399-
onClick={onClose}
400-
/>
401-
)}
396+
<CSSMotion
397+
motionName={motionName}
398+
visible={portalRender && open}
399+
motionAppear
400+
motionEnter
401+
motionLeave>
402+
{({ className: motionClassName, style: motionStyle }) => {
403+
return (<div
404+
className={clsx(`${prefixCls}-mask`, classNames.mask, motionClassName)}
405+
style={{ ...styles.mask, ...motionStyle }}
406+
onClick={onClose}
407+
/>);
408+
}}
409+
</CSSMotion>
402410
<CSSMotion
403411
motionName={motionName}
404412
visible={portalRender && open}

0 commit comments

Comments
 (0)