From 4399c9c75ae93490fb9548ed254f23a7d6493797 Mon Sep 17 00:00:00 2001 From: "Eevee (Evelyn Woods)" Date: Sat, 13 Mar 2021 20:16:37 -0700 Subject: [PATCH] Fix kb shortcuts no longer working in the editor after editing level properties --- js/main-base.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/main-base.js b/js/main-base.js index 27f261a..5b4b83c 100644 --- a/js/main-base.js +++ b/js/main-base.js @@ -141,6 +141,11 @@ export class Overlay { close() { this._remove_global_event_handlers(); this.root.closest('.overlay').remove(); + if (document.activeElement) { + // The active element is almost certainly either the dialog or a control within it, + // which is useless as a focus target, so blur it and let the page have focus + document.activeElement.blur(); + } } }