Skip to content

Commit

Permalink
Required fields validated correctly when they are empty or zero.
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrczarnas committed Jan 13, 2024
1 parent 0a254f9 commit 4ce7c1e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const FieldControl = ({
});
};

const isInvalid = !field.optional && !disabled && (!value || (Array.isArray(value) && value.length === 0));
const isInvalid = !field.optional && !disabled && (value === undefined || value === '' || (Array.isArray(value) && value.length === 0));
return (
<div>
{type === 'boolean' && (
Expand Down

0 comments on commit 4ce7c1e

Please sign in to comment.