From 0d79b5348acb9142c96799e33c1bc113a38233ba Mon Sep 17 00:00:00 2001 From: Ahmedhossamdev Date: Wed, 13 Nov 2024 18:17:51 +0200 Subject: [PATCH] fix: prevent empty search submissions and disable button accordingly --- src/components/search/SearchField.svelte | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/search/SearchField.svelte b/src/components/search/SearchField.svelte index 40e86ba..d710a2c 100644 --- a/src/components/search/SearchField.svelte +++ b/src/components/search/SearchField.svelte @@ -17,6 +17,9 @@ } const onHandleSearch = (event) => { + if (!value) { + return; + } if (event.key === 'Enter' || typeof event.key === 'undefined') { handleSearch(); } @@ -57,7 +60,8 @@