fix: Modal conflicting props classNames.wrapper and centered (#47076)

* fix: conflict wrapper and centered

* test: update snap

* fix: undefined className

* refactor: use classNames for merge class
This commit is contained in:
sunsunmonkey 2024-01-20 23:59:54 +08:00 committed by GitHub
parent 87b45e6198
commit d25b4c1b46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -144,9 +144,9 @@ const Modal: React.FC<ModalProps> = (props) => {
className={classNames(hashId, className, modal?.className)}
style={{ ...modal?.style, ...style }}
classNames={{
wrapper: wrapClassNameExtended,
...modal?.classNames,
...modalClassNames,
wrapper: classNames(wrapClassNameExtended, modalClassNames?.wrapper),
}}
styles={{
...modal?.styles,

View File

@ -52,7 +52,7 @@ export interface ModalProps extends ModalCommonProps {
transitionName?: string;
className?: string;
rootClassName?: string;
classNames?: Omit<NonNullable<DialogProps['classNames']>, 'wrapper'>;
classNames?: NonNullable<DialogProps['classNames']>;
getContainer?: string | HTMLElement | getContainerFunc | false;
zIndex?: number;
/** @deprecated Please use `styles.body` instead */