From f3cc8dfe0db15ca61ac766cc459cdb02844ce2e0 Mon Sep 17 00:00:00 2001 From: elios Date: Thu, 9 Mar 2017 20:55:47 -0600 Subject: [PATCH] + call onCancel when pressing esc key (#5209) * + call onCancel when pressing esc key * + call onCancel when press esc corrections --- components/modal/confirm.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/modal/confirm.tsx b/components/modal/confirm.tsx index 5ac7409d52..497e30d2f1 100644 --- a/components/modal/confirm.tsx +++ b/components/modal/confirm.tsx @@ -30,11 +30,12 @@ export default function confirm(config) { (props.okCancel ? runtimeLocale.okText : runtimeLocale.justOkText); props.cancelText = props.cancelText || runtimeLocale.cancelText; - function close() { + function close(...args) { const unmountResult = ReactDOM.unmountComponentAtNode(div); if (unmountResult && div.parentNode) { div.parentNode.removeChild(div); } + props.onCancel(...args); } let body = (