Skip to content

Commit

Permalink
For ant-design#11537, Centered style should be applied to the wrap el…
Browse files Browse the repository at this point in the history
…ement.
  • Loading branch information
yoyo837 committed Aug 1, 2018
1 parent f4d631d commit 4495077
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions components/modal/Modal.tsx
Expand Up @@ -181,7 +181,7 @@ export default class Modal extends React.Component<ModalProps, {}> {
}

render() {
const { footer, visible, className, centered, prefixCls, ...restProps } = this.props;
const { footer, visible, wrapClassName, centered, prefixCls, ...restProps } = this.props;

const defaultFooter = (
<LocaleReceiver
Expand All @@ -196,7 +196,7 @@ export default class Modal extends React.Component<ModalProps, {}> {
<Dialog
{...restProps}
prefixCls={prefixCls}
className={classNames({ [`${prefixCls}-centered`]: !!centered }, className)}
wrapClassName={classNames({ [`${prefixCls}-centered`]: !!centered }, wrapClassName)}
footer={footer === undefined ? defaultFooter : footer}
visible={visible}
mousePosition={mousePosition}
Expand Down
4 changes: 1 addition & 3 deletions components/modal/confirm.tsx
Expand Up @@ -32,9 +32,6 @@ const ConfirmDialog = (props: ConfirmDialogProps) => {
const classString = classNames(
prefixCls,
`${prefixCls}-${props.type}`,
{
[`${prefixCls}-centered`]: !!props.centered,
},
props.className,
);

Expand All @@ -47,6 +44,7 @@ const ConfirmDialog = (props: ConfirmDialogProps) => {
return (
<Dialog
className={classString}
wrapClassName={classNames({ [`${prefixCls}-centered`]: !!props.centered })}
onCancel={close.bind(this, { triggerCancel: true })}
visible={visible}
title=""
Expand Down

0 comments on commit 4495077

Please sign in to comment.