Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Form): added name to fieldState #643

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

hrynevychroman
Copy link
Collaborator

update useFormField function fieldState definition

  • 📖 Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 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
  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link
Collaborator

@sadeghbarati sadeghbarati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, since we mostly using useForm instead of <Form> component

useIsFieldValid
resolveFieldOrPathState might not work perfectly

Passing name to these functions is LGTM

@sadeghbarati sadeghbarati changed the title fix(vee-validate): added name to fieldState fix(Form): added name to fieldState Jul 2, 2024
@hrynevychroman
Copy link
Collaborator Author

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

@sadeghbarati
Copy link
Collaborator

sadeghbarati commented Jul 2, 2024

Sure do it yourself 🥇 squash it

@hrynevychroman hrynevychroman merged commit d50ea38 into unovue:dev Jul 2, 2024
2 checks passed
@hrynevychroman hrynevychroman deleted the fix/vee-validate-form branch July 2, 2024 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants