+ call onCancel when pressing esc key (#5209)

* + call onCancel when pressing esc key

* + call onCancel when press esc corrections
This commit is contained in:
elios 2017-03-09 20:55:47 -06:00 committed by 偏右
parent c91704854b
commit f3cc8dfe0d

View File

@ -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 = (