fix: scan modal ignores backdrop clicks so a focus click cannot dismiss it

Only its own buttons dismiss it: Cancel before a scan starts, Hide (minimize
to the progress pill) while one runs.
This commit is contained in:
Vito Sansevero
2026-10-08 18:01:34 -07:00
parent b98c716b48
commit ce983af09f
+5 -6
View File
@@ -248,10 +248,9 @@
document.querySelectorAll("[id$='Modal']").forEach((modal) => {
modal.addEventListener("click", (e) => {
if (e.target !== modal) return;
if (modal.id === "scanModal") {
this.dismissScanModal(); // a running scan minimizes instead of closing
return;
}
// The scan modal only leaves through its own buttons (Cancel / Hide): a click
// that merely focuses the window must not close or minimize a long job.
if (modal.id === "scanModal") return;
modal.classList.add("hidden");
modal.classList.remove("flex");
document.body.style.overflow = "";
@@ -2107,8 +2106,8 @@
// Scan functionality
//
// The scan is a background job on the server. The modal shows its progress,
// can be hidden to a small pill while it runs, and re-attaches to a scan that
// is still running after a page reload.
// can be hidden to a small pill with the Hide button while it runs (backdrop
// clicks are ignored), and re-attaches to a scan still running after a reload.
showScanModal() {
if (this.scanState.status !== ScanProgress.RUNNING) this.resetScanControls();
document.getElementById("scanPill").classList.add("hidden");