conform icon indicating copy to clipboard operation
conform copied to clipboard

empty string is not accepted in non-optional validation schema

Open depsimon opened this issue 9 months ago • 0 comments

Describe the bug and the expected behavior

I want to accept empty strings in my form, but conform sends undefined values instead of empty strings.

Conform version

v1.1.0

Steps to Reproduce the Bug or Issue

Full reproduction: https://stackblitz.com/edit/remix-run-remix-zma3um?file=app%2Froutes%2F_index.tsx

I added the valibot and zod versions.

If you send an empty form, you'll get "The name should be a string" instead of "The name is required". The description should be valid as an empty string.

I added the optional page that has the expected result but this allows for the field to not be passed, which is not what we want.

What browsers are you seeing the problem on?

Chrome, Firefox, Microsoft Edge, Safari, Others

Screenshots or Videos

No response

Additional context

I originally thought it was related to this issue.

depsimon avatar May 07 '24 08:05 depsimon