aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/components/dashboard
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/components/dashboard')
-rw-r--r--apps/web/components/dashboard/search/SearchInput.tsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/web/components/dashboard/search/SearchInput.tsx b/apps/web/components/dashboard/search/SearchInput.tsx
index 0f752fde..a7caf44e 100644
--- a/apps/web/components/dashboard/search/SearchInput.tsx
+++ b/apps/web/components/dashboard/search/SearchInput.tsx
@@ -20,7 +20,11 @@ function useFocusSearchOnKeyPress(
const length = inputRef.current.value.length;
inputRef.current.setSelectionRange(length, length);
}
- if (e.code === "Escape") {
+ if (
+ e.code === "Escape" &&
+ e.target == inputRef.current &&
+ inputRef.current.value !== ""
+ ) {
e.preventDefault();
inputRef.current.blur();
inputRef.current.value = "";