From 40e39367f630d7dab99b23e26895b124fd8a53e4 Mon Sep 17 00:00:00 2001 From: "Stiliyan Tonev (Bark)" Date: Wed, 25 Jun 2025 10:24:37 +0300 Subject: [PATCH] WebUI: Allow closing modals with Escape Closes [#13891](https://github.com/qbittorrent/qBittorrent/issues/13891) --- src/webui/www/private/scripts/client.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/webui/www/private/scripts/client.js b/src/webui/www/private/scripts/client.js index 01f29e25f..082b55726 100644 --- a/src/webui/www/private/scripts/client.js +++ b/src/webui/www/private/scripts/client.js @@ -1773,6 +1773,15 @@ window.addEventListener("DOMContentLoaded", (event) => { event.preventDefault(); deleteSelectedTorrentsFN(event.shiftKey); break; + + case "Escape": + if (event.target.isContentEditable) + return; + event.preventDefault(); + Object.values(MochaUI.Windows.instances).forEach((modal) => { + modal.close(); + }); + break; } });