From e667352329651c25dc2d283eaa6cc8ca872040f6 Mon Sep 17 00:00:00 2001 From: metonym Date: Tue, 21 Nov 2023 10:17:19 -0800 Subject: [PATCH] fix(header-search): "Escape" should close empty search bar (#1853) --- src/UIShell/HeaderSearch.svelte | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/UIShell/HeaderSearch.svelte b/src/UIShell/HeaderSearch.svelte index d0128d0c..4c438269 100644 --- a/src/UIShell/HeaderSearch.svelte +++ b/src/UIShell/HeaderSearch.svelte @@ -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 = '';