For #11537, Centered style should be applied to the wrap element.

This commit is contained in:
yoyo837 2018-08-01 10:50:34 +08:00 committed by 偏右
parent f4d631ddc2
commit eab74fa693
2 changed files with 3 additions and 5 deletions

View File

@ -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
@ -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}

View File

@ -32,9 +32,6 @@ const ConfirmDialog = (props: ConfirmDialogProps) => {
const classString = classNames(
prefixCls,
`${prefixCls}-${props.type}`,
{
[`${prefixCls}-centered`]: !!props.centered,
},
props.className,
);
@ -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=""