diff --git a/frontend/src/ts/commandline/commandline.ts b/frontend/src/ts/commandline/commandline.ts index 69c24623b..b26237da0 100644 --- a/frontend/src/ts/commandline/commandline.ts +++ b/frontend/src/ts/commandline/commandline.ts @@ -646,6 +646,8 @@ const modal = new AnimatedModal({ } } if (e.key === "Escape") { + e.preventDefault(); + e.stopPropagation(); await goBackOrHide(); } }); diff --git a/frontend/src/ts/utils/animated-modal.ts b/frontend/src/ts/utils/animated-modal.ts index af8f06c1a..0677a6f34 100644 --- a/frontend/src/ts/utils/animated-modal.ts +++ b/frontend/src/ts/utils/animated-modal.ts @@ -134,6 +134,8 @@ export default class AnimatedModal< async runSetup(): Promise { this.wrapperEl.addEventListener("keydown", (e) => { if (e.key === "Escape" && isPopupVisible(this.dialogId)) { + e.preventDefault(); + e.stopPropagation(); if (this.customEscapeHandler !== undefined) { this.customEscapeHandler(e); } else {