Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: `${wrapClassNameExtended} ${modalClassNames?.wrapper || ''}`,
afc163 marked this conversation as resolved.
Show resolved Hide resolved
}}
styles={{
...modal?.styles,
Expand Down
6 changes: 3 additions & 3 deletions components/modal/__tests__/__snapshots__/Modal.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ exports[`Modal render correctly 1`] = `
class="ant-modal-mask ant-fade-appear ant-fade-appear-start ant-fade"
/>
<div
class="ant-modal-wrap"
class="ant-modal-wrap "
tabindex="-1"
>
<div
Expand Down Expand Up @@ -151,7 +151,7 @@ exports[`Modal render without footer 1`] = `
class="ant-modal-mask ant-fade-appear ant-fade-appear-start ant-fade"
/>
<div
class="ant-modal-wrap"
class="ant-modal-wrap "
tabindex="-1"
>
<div
Expand Down Expand Up @@ -226,7 +226,7 @@ exports[`Modal support closeIcon 1`] = `
class="ant-modal-mask ant-fade-appear ant-fade-appear-start ant-fade"
/>
<div
class="ant-modal-wrap"
class="ant-modal-wrap "
tabindex="-1"
>
<div
Expand Down
2 changes: 1 addition & 1 deletion components/modal/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down