Skip to content

Commit

Permalink
1584
Browse files Browse the repository at this point in the history
  • Loading branch information
saranyaviswam committed Sep 13, 2024
1 parent 3ce2d73 commit 377101d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ const Renderer: React.FC<RendererProps> = ({ data }) => {
for (const validation of validations) {
switch (validation.type) {
case "required":
if (!fieldValue || fieldValue.trim() === "") {
if (fieldValue === null || fieldValue === undefined || fieldValue === "") {
return validation.errorMessage || `${field.label} is required.`;
}
break;
Expand All @@ -337,7 +337,7 @@ const Renderer: React.FC<RendererProps> = ({ data }) => {
break;
// Add more validation types as needed
case "minLength":
if (fieldValue !== null && fieldValue.trim()!==""){
if (fieldValue !== null && fieldValue.trim()!==""){
if (fieldValue.length < validation.value) {
return (
validation.errorMessage ||
Expand Down

0 comments on commit 377101d

Please sign in to comment.