diff --git a/backend/static/filter.js b/backend/static/filter.js index 4e27c1e..3cddea3 100644 --- a/backend/static/filter.js +++ b/backend/static/filter.js @@ -106,7 +106,12 @@ function toggleConfirmRow(key, kind) { // unhides: it makes the announcement deterministic, keeps tab order inside // the confirm instead of running on into the next card, and means the row // cannot be opened and scrolled past unnoticed. - if (row && !row.hidden) row.querySelector("button").focus(); + // The reversible rows open on their affirmative; remove opens on Cancel. + // Focusing the first button in DOM order would hand the irreversible action + // a pre-armed Enter, which is the opposite of what a confirm gate is for. + if (row && !row.hidden) { + row.querySelector(row.classList.contains("calm") ? "button" : "button + button").focus(); + } } // Esc closes whichever panel this card has open and hands focus back to the