fix(quick-search): Esc closes only the modal; cancel returns focus to target

- The qsInput Esc handler didn't stopPropagation, so the SAME keystroke fell
  through to the document-level Esc handlers which, seeing the modal now
  closed, also closed (or discard-prompted) the dirty slideover behind it.
- autofill/cancel now hands the foreground back to the saved target HWND:
  Esc after a fill-mode hotkey returns the user to the window they came
  from instead of leaving our app focused. Locked-vault path still ends
  focused on us (cancelAutofill runs before focusApp).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
r-zakarya
2026-07-12 20:20:24 +01:00
parent 770504ea03
commit 3d217e82d4
2 changed files with 9 additions and 0 deletions
+4
View File
@@ -7964,6 +7964,10 @@ async function init() {
const rows = document.querySelectorAll('#quickSearchResults .quick-search-row');
if (e.key === 'Escape') {
e.preventDefault();
// Kill the keystroke: without this the SAME Esc reaches the
// document-level handlers, which now see "no modal open"
// (we just closed it) and also close the dirty slideover.
e.stopPropagation();
closeQuickSearchModal();
} else if (e.key === 'ArrowDown') {
e.preventDefault();