messageBox.element is nulled in close()

This commit is contained in:
tophf 2022-06-03 18:41:25 +03:00
parent cd88aff733
commit 2e1961bdf7

View File

@ -150,10 +150,10 @@ messageBox.show = async ({
function resolveWith(value) { function resolveWith(value) {
setTimeout(messageBox._resolve, 0, value); setTimeout(messageBox._resolve, 0, value);
messageBox.close(true);
if (messageBox.element.contains(document.activeElement)) { if (messageBox.element.contains(document.activeElement)) {
messageBox._originalFocus.focus(); messageBox._originalFocus.focus();
} }
messageBox.close(true);
} }
function createElement() { function createElement() {