From f7609a04a7002f1a1f6dc9d5daee3a01e0bb01a2 Mon Sep 17 00:00:00 2001 From: DisLido Date: Sat, 9 Nov 2024 17:13:22 +0800 Subject: [PATCH] fix(Image): preview.rootClassName (#51538) Co-authored-by: afc163 --- components/image/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/image/index.tsx b/components/image/index.tsx index 45d02ba067..cd694b26dd 100644 --- a/components/image/index.tsx +++ b/components/image/index.tsx @@ -54,7 +54,7 @@ const Image: CompositionImage = (props) => { return preview; } const _preview = typeof preview === 'object' ? preview : {}; - const { getContainer, closeIcon, ...restPreviewProps } = _preview; + const { getContainer, closeIcon, rootClassName, ...restPreviewProps } = _preview; return { mask: (
@@ -64,6 +64,7 @@ const Image: CompositionImage = (props) => { ), icons, ...restPreviewProps, + rootClassName: classNames(mergedRootClassName, rootClassName), getContainer: getContainer ?? getContextPopupContainer, transitionName: getTransitionName(rootPrefixCls, 'zoom', _preview.transitionName), maskTransitionName: getTransitionName(rootPrefixCls, 'fade', _preview.maskTransitionName),