Skip to content

Commit

Permalink
fix(header-search): blur input when active is false (#1857)
Browse files Browse the repository at this point in the history
  • Loading branch information
metonym committed Nov 23, 2023
1 parent decf966 commit 6c9cf9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/UIShell/HeaderSearch.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
}
$: if (active && ref) ref.focus();
$: if (!active && ref) ref.blur();
$: dispatch(active ? "active" : "inactive");
$: selectedResult = results[selectedResultIndex];
$: selectedId = selectedResult
Expand Down Expand Up @@ -116,9 +117,8 @@
break;
case 'Escape':
if (value === '') {
// If the search bar is empty, deactivate and blur the input.
// If the search bar is empty, deactivate the input.
active = false;
ref?.blur();
}

// Reset the search query but keep the search bar active.
Expand Down

0 comments on commit 6c9cf9e

Please sign in to comment.