From 5ec8264143befbdfede19c25ef2dcfecb2ee1fac Mon Sep 17 00:00:00 2001
From: Dima Rifai <dima.rifai@gmail.com>
Date: Tue, 17 Dec 2024 09:20:56 +0200
Subject: [PATCH] Issue #395 - Validate numeric fields on search ranges

---
 components/searchRanges/SearchRanges.tsx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/components/searchRanges/SearchRanges.tsx b/components/searchRanges/SearchRanges.tsx
index 1b4316d6..ab1d6967 100644
--- a/components/searchRanges/SearchRanges.tsx
+++ b/components/searchRanges/SearchRanges.tsx
@@ -37,10 +37,10 @@ const SearchRanges: React.FC<SearchRangesProps> = ({
   } = rangesProps;
 
   const setNumericValue = (value: number, fieldSetter: Function) => {
-    if (value === 0) {
-      fieldSetter(undefined);
-    } else {
+    if (!Number.isNaN(value) && value > 0) {
       fieldSetter(value);
+    } else {
+      fieldSetter(undefined);
     }
   };
 
-- 
GitLab