fix(Image): preview.rootClassName (#51538)

Co-authored-by: afc163 <afc163@gmail.com>
This commit is contained in:
DisLido 2024-11-09 17:13:22 +08:00 committed by GitHub
parent f6afb89f17
commit f7609a04a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -54,7 +54,7 @@ const Image: CompositionImage<ImageProps> = (props) => {
return preview;
}
const _preview = typeof preview === 'object' ? preview : {};
const { getContainer, closeIcon, ...restPreviewProps } = _preview;
const { getContainer, closeIcon, rootClassName, ...restPreviewProps } = _preview;
return {
mask: (
<div className={`${prefixCls}-mask-info`}>
@ -64,6 +64,7 @@ const Image: CompositionImage<ImageProps> = (props) => {
),
icons,
...restPreviewProps,
rootClassName: classNames(mergedRootClassName, rootClassName),
getContainer: getContainer ?? getContextPopupContainer,
transitionName: getTransitionName(rootPrefixCls, 'zoom', _preview.transitionName),
maskTransitionName: getTransitionName(rootPrefixCls, 'fade', _preview.maskTransitionName),