Skip to content

Commit 34f5a25

Browse files
committed
feat: add closable option for confirm dialog
1 parent d478653 commit 34f5a25

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

components/modal/ConfirmDialog.jsx

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export default {
2121
maskStyle,
2222
okButtonProps,
2323
cancelButtonProps,
24+
closable = false,
2425
} = props;
2526
const iconType = props.iconType || 'question-circle';
2627
const okType = props.okType || 'primary';
@@ -62,6 +63,7 @@ export default {
6263
wrapClassName={classNames({ [`${contentPrefixCls}-centered`]: !!centered })}
6364
onCancel={e => close({ triggerCancel: true }, e)}
6465
visible={visible}
66+
closable={closable}
6567
title=""
6668
transitionName="zoom"
6769
footer=""

components/modal/index.en-US.md

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ The properties of the object are follows:
5353
| autoFocusButton | Specify which button to autofocus | null\|string: `ok` `cancel` | `ok` |
5454
| cancelText | Text of the Cancel button | string | `Cancel` |
5555
| centered | Centered Modal | Boolean | `false` |
56+
| closable | Whether a close (x) button is visible on top right of the modal dialog or not | boolean | `false` |
5657
| class | class of container | string | - |
5758
| content | Content | string\|vNode | - |
5859
| iconType | Icon `type` of the Icon component | string | `question-circle` |

components/modal/index.zh-CN.md

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
| autoFocusButton | 指定自动获得焦点的按钮 | null\|string: `ok` `cancel` | `ok` |
5353
| cancelText | 取消按钮文字 | string | 取消 |
5454
| centered | 垂直居中展示 Modal | Boolean | `false` |
55+
| closable | 是否显示右上角的关闭按钮 | boolean | `false` |
5556
| class | 容器类名 | string | - |
5657
| content | 内容 | string\|vNode ||
5758
| iconType | 图标 Icon 类型 | string | question-circle |

components/modal/style/confirm.less

-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
display: none;
88
}
99

10-
.@{ant-prefix}-modal-close {
11-
display: none;
12-
}
13-
1410
.@{ant-prefix}-modal-body {
1511
padding: 32px 32px 24px;
1612
}

0 commit comments

Comments
 (0)