Browse Source

+ call onCancel when pressing esc key (#5209)

* + call onCancel when pressing esc key

* + call onCancel when press esc corrections
pull/4684/merge
elios 8 years ago
committed by 偏右
parent
commit
f3cc8dfe0d
  1. 3
      components/modal/confirm.tsx

3
components/modal/confirm.tsx

@ -30,11 +30,12 @@ export default function confirm(config) {
(props.okCancel ? runtimeLocale.okText : runtimeLocale.justOkText); (props.okCancel ? runtimeLocale.okText : runtimeLocale.justOkText);
props.cancelText = props.cancelText || runtimeLocale.cancelText; props.cancelText = props.cancelText || runtimeLocale.cancelText;
function close() { function close(...args) {
const unmountResult = ReactDOM.unmountComponentAtNode(div); const unmountResult = ReactDOM.unmountComponentAtNode(div);
if (unmountResult && div.parentNode) { if (unmountResult && div.parentNode) {
div.parentNode.removeChild(div); div.parentNode.removeChild(div);
} }
props.onCancel(...args);
} }
let body = ( let body = (

Loading…
Cancel
Save