mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 03:59:01 +08:00
fix: Modal.method bodyStyle not working (#32934)
* fix: Modal.method bodyStyle失效 * test: Modal.method bodyStyle失效 * Apply suggestions from code review Co-authored-by: 晋文涛 <jinwentao@zhaojiafang.com> Co-authored-by: afc163 <afc163@gmail.com>
This commit is contained in:
parent
4ca697611f
commit
30844793a2
@ -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}
|
||||
|
||||
>
|
||||
<div className={`${contentPrefixCls}-body-wrapper`}>
|
||||
<div className={`${contentPrefixCls}-body`} style={bodyStyle}>
|
||||
<div className={`${contentPrefixCls}-body`}>
|
||||
{icon}
|
||||
{props.title === undefined ? null : (
|
||||
<span className={`${contentPrefixCls}-title`}>{props.title}</span>
|
||||
|
@ -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");
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user