Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add NaN check to number input validator
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent 59eac97 commit 86f6729
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions components/FormGenerator.tsx
Expand Up @@ -39,6 +39,7 @@ export default function ({
function isNumberElemInvalid(e: HTMLInputElement): boolean {
return !(
e.value ||
isNaN(e.valueAsNumber) ||
e.valueAsNumber <= Number.MAX_SAFE_INTEGER ||
e.valueAsNumber >= Number.MIN_SAFE_INTEGER
);
Expand Down

0 comments on commit 86f6729

Please sign in to comment.