Browse Source

fix input error

Signed-off-by: ryjiang <jiangruiyi@gmail.com>
ryjiang 1 year ago
parent
commit
a7b950326f

+ 1 - 1
client/src/components/customInput/CustomInput.tsx

@@ -52,7 +52,7 @@ const handleOnChange = (param: IChangeParam) => {
   let input = event.target.value;
   let input = event.target.value;
 
 
   // fix for number input
   // fix for number input
-  if (!isNaN(input)) {
+  if (!isNaN(input) && input.trim() !== '') {
     input = parseFloat(input);
     input = parseFloat(input);
   }
   }
 
 

+ 1 - 0
client/src/pages/search/SearchParams.tsx

@@ -300,6 +300,7 @@ const SearchParams: FC<SearchParamsProps> = ({
           max: 1,
           max: 1,
           isInt: false,
           isInt: false,
           type: 'number',
           type: 'number',
+          required: false,
           handleChange: value => {
           handleChange: value => {
             handleInputChange('drop_ratio_search', value);
             handleInputChange('drop_ratio_search', value);
           },
           },