vee-validate icon indicating copy to clipboard operation
vee-validate copied to clipboard

fix: send transformed values as submitted values with useField

Open mehcode opened this issue 11 months ago • 1 comments

🔎 Overview

This PR allows transforms to be sent through as the submitted value when the transform is used in useField and not as a high-level object schema.

🤓 Code snippets/examples (if applicable)

See the added test to zod.spec.ts

      const testRules = toTypedSchema(z.string().transform(value => `modified: ${value}`));
      const { value } = useField('test', testRules);

This functionally works but definitely needs some help with the internal types. Not sure how to make them work in the greater scheme without a lot more effort and could use some guidance. Thank you!

mehcode avatar Mar 08 '24 00:03 mehcode

@logaretm Is there anything I can help with to get this merged and released?

mehcode avatar Mar 19 '24 00:03 mehcode