You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think i may have found a minor issue, but it may also be me just misunderstanding and doing something wrong.
Given a setup like this:
constvalidationSchema=toTypedSchema(yup.object({name: yup.string().required(),}))constinitialValues={name: '',deletedAt: null,// no input exists for this}const{ handleSubmit, controlledValues }=useForm({ validationSchema, initialValues })
If I have a single child input component with useField('name'), I find that controlledValues only contains name, but the values argument provided in handleSubmit.withControlled contains both name and deletedAt.
Not sure if this is intended, but if I don't use a validation schema, or if I use a schema directly without toTypedSchema, this inconsistency stops. Maybe I have to use yup default values and not initial values in combination with toTypedSchema, but I still find it a bit odd that they don't match.
What happened?
First of all, love the project!
I think i may have found a minor issue, but it may also be me just misunderstanding and doing something wrong.
Given a setup like this:
If I have a single child input component with
useField('name')
, I find thatcontrolledValues
only contains name, but thevalues
argument provided inhandleSubmit.withControlled
contains both name and deletedAt.Not sure if this is intended, but if I don't use a validation schema, or if I use a schema directly without
toTypedSchema
, this inconsistency stops. Maybe I have to use yup default values and not initial values in combination withtoTypedSchema
, but I still find it a bit odd that they don't match.Reproduction steps
Version
Vue.js 3.x and vee-validate 4.x
What browsers are you seeing the problem on?
Relevant log output
No response
Demo link
https://stackblitz.com/edit/vitejs-vite-yq9jxqbt?file=src%2Fcomponents%2FSampleForm.vue
Code of Conduct
The text was updated successfully, but these errors were encountered: