diff --git a/components/modal/ConfirmDialog.tsx b/components/modal/ConfirmDialog.tsx index 0c460e9226..547528e7d8 100644 --- a/components/modal/ConfirmDialog.tsx +++ b/components/modal/ConfirmDialog.tsx @@ -95,6 +95,7 @@ const ConfirmDialog = (props: ConfirmDialogProps) => { maskClosable={maskClosable} maskStyle={maskStyle} style={style} + bodyStyle={bodyStyle} width={width} zIndex={zIndex} afterClose={afterClose} @@ -105,9 +106,10 @@ const ConfirmDialog = (props: ConfirmDialogProps) => { closeIcon={closeIcon} modalRender={modalRender} focusTriggerAfterClose={focusTriggerAfterClose} + >
-
+
{icon} {props.title === undefined ? null : ( {props.title} diff --git a/components/modal/__tests__/confirm.test.js b/components/modal/__tests__/confirm.test.js index d443d45da4..dfd4814db8 100644 --- a/components/modal/__tests__/confirm.test.js +++ b/components/modal/__tests__/confirm.test.js @@ -545,4 +545,10 @@ describe('Modal.confirm triggers callbacks correctly', () => { await sleep(500); expect(afterClose).toHaveBeenCalled(); }); + + it('bodyStyle', async () => { + open({ bodyStyle: { width: 500 }}); + const {width} = $$('.ant-modal-body')[0].style; + expect(width).toBe("500px"); + }); });