Skip to content

Commit

Permalink
fix: ensure for number range that value is not empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
kunstmusik committed Oct 4, 2024
1 parent 21b5a69 commit 163004a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/forms/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const validateNumberRange = (
return (v: string) => {
const value = +v;

return value < min || value > max || isNaN(value)
return v.length == 0 || value < min || value > max || isNaN(value)
? `${propertyName} must be a number from ${min} to ${max}.`
: undefined;
};
Expand Down

0 comments on commit 163004a

Please sign in to comment.