radix-vue / shadcn-vue

Vue port of shadcn-ui
https://www.shadcn-vue.com/
MIT License
3.58k stars 207 forks source link

fix(Form): added `name` to fieldState #643

Closed romanhrynevych closed 3 days ago

romanhrynevych commented 3 days ago

update useFormField function fieldState definition

๐Ÿ“š Description

On my own project, I had a problem with useFormField; there are no changes inside the FormControl component, aria-invalid property remains unchanged, but errors were inside the errors object returned from useForm vee-validate. Some time was needed to find the problem, and it was inside the useFormField function, where fieldState was just generated with useFieldError, for example, without passing the name inside. After just adding name, everything worked fine. This occurred on custom phone input with select and input that only receives the :name property from the parent slot.

๐Ÿ“ธ Screenshots (if appropriate)

image
romanhrynevych commented 3 days ago

@sadeghbarati thanks! Who needs to squash and merge? Can I do this?

sadeghbarati commented 3 days ago

Sure do it yourself ๐Ÿฅ‡ squash it