diff --git a/frontend/src/lib/components/file/TagPicker.svelte b/frontend/src/lib/components/file/TagPicker.svelte index 870c94f..2be3fc3 100644 --- a/frontend/src/lib/components/file/TagPicker.svelte +++ b/frontend/src/lib/components/file/TagPicker.svelte @@ -109,6 +109,12 @@ void handleRemove(tag.id); assignedFocusIdx = Math.min(assignedFocusIdx, filteredAssigned.length - 2); } + } else if (e.key === 'Escape') { + // Let the keyboard leave the field: blur back to the page so arrow keys + // and Escape reach the viewer again (e.g. a second Esc closes it). + e.preventDefault(); + assignedFocusIdx = -1; + (e.currentTarget as HTMLInputElement).blur(); } } diff --git a/frontend/src/lib/components/layout/KeyboardHelp.svelte b/frontend/src/lib/components/layout/KeyboardHelp.svelte index ee37712..3410181 100644 --- a/frontend/src/lib/components/layout/KeyboardHelp.svelte +++ b/frontend/src/lib/components/layout/KeyboardHelp.svelte @@ -49,7 +49,7 @@ ['& | ! ( )', 'Insert an operator (filter only)'], ['Ctrl+Enter', 'Apply the filter'], ['Ctrl+Backspace', 'Reset the filter'], - ['Esc', 'Close'] + ['Esc', 'Leave the field / close'] ] } ];