Browse Source

Add getContainer to Modal.info etc, close #11377

pull/11884/head
afc163 6 years ago
parent
commit
877f9fd7d6
  1. 1
      components/modal/Modal.tsx
  2. 3
      components/modal/confirm.tsx

1
components/modal/Modal.tsx

@ -79,6 +79,7 @@ export interface ModalFuncProps {
style?: React.CSSProperties; style?: React.CSSProperties;
type?: string; type?: string;
keyboard?: boolean; keyboard?: boolean;
getContainer?: (instance: React.ReactInstance) => HTMLElement;
} }
export type ModalFunc = (props: ModalFuncProps) => { export type ModalFunc = (props: ModalFuncProps) => {

3
components/modal/confirm.tsx

@ -14,7 +14,7 @@ interface ConfirmDialogProps extends ModalFuncProps {
const IS_REACT_16 = !!ReactDOM.createPortal; const IS_REACT_16 = !!ReactDOM.createPortal;
const ConfirmDialog = (props: ConfirmDialogProps) => { const ConfirmDialog = (props: ConfirmDialogProps) => {
const { onCancel, onOk, close, zIndex, afterClose, visible, keyboard } = props; const { onCancel, onOk, close, zIndex, afterClose, visible, keyboard, getContainer } = props;
const iconType = props.iconType || 'question-circle'; const iconType = props.iconType || 'question-circle';
const okType = props.okType || 'primary'; const okType = props.okType || 'primary';
const prefixCls = props.prefixCls || 'ant-confirm'; const prefixCls = props.prefixCls || 'ant-confirm';
@ -57,6 +57,7 @@ const ConfirmDialog = (props: ConfirmDialogProps) => {
zIndex={zIndex} zIndex={zIndex}
afterClose={afterClose} afterClose={afterClose}
keyboard={keyboard} keyboard={keyboard}
getContainer={getContainer}
> >
<div className={`${prefixCls}-body-wrapper`}> <div className={`${prefixCls}-body-wrapper`}>
<div className={`${prefixCls}-body`}> <div className={`${prefixCls}-body`}>

Loading…
Cancel
Save