diff --git a/components/modal/Modal.tsx b/components/modal/Modal.tsx index 450f6f2e2c..f2e4334337 100644 --- a/components/modal/Modal.tsx +++ b/components/modal/Modal.tsx @@ -79,6 +79,7 @@ export interface ModalFuncProps { style?: React.CSSProperties; type?: string; keyboard?: boolean; + getContainer?: (instance: React.ReactInstance) => HTMLElement; } export type ModalFunc = (props: ModalFuncProps) => { diff --git a/components/modal/confirm.tsx b/components/modal/confirm.tsx index ccd29ff0ca..b888e02c90 100644 --- a/components/modal/confirm.tsx +++ b/components/modal/confirm.tsx @@ -14,7 +14,7 @@ interface ConfirmDialogProps extends ModalFuncProps { const IS_REACT_16 = !!ReactDOM.createPortal; 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 okType = props.okType || 'primary'; const prefixCls = props.prefixCls || 'ant-confirm'; @@ -57,6 +57,7 @@ const ConfirmDialog = (props: ConfirmDialogProps) => { zIndex={zIndex} afterClose={afterClose} keyboard={keyboard} + getContainer={getContainer} >