Skip to content

Commit

Permalink
fix(header-search): "Escape" should close empty search bar (#1853)
Browse files Browse the repository at this point in the history
  • Loading branch information
metonym authored Nov 21, 2023
1 parent b0b51a8 commit e667352
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/UIShell/HeaderSearch.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@
}
break;
case 'Escape':
if (value === '') {
// If the search bar is empty, close it.
active = false;
}

// Reset the search query but keep the search bar active.
// Do not dispatch "clear" event as that should fire only on the "x" button.
value = '';
Expand Down

0 comments on commit e667352

Please sign in to comment.