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): return state on validate #472

Merged
merged 4 commits into from
Aug 1, 2023
Merged

fix(Form): return state on validate #472

merged 4 commits into from
Aug 1, 2023

Conversation

romhml
Copy link
Collaborator

@romhml romhml commented Jul 31, 2023

@benjamincanac Spotted a few issues in the last examples in the docs.

@vercel
Copy link

vercel bot commented Jul 31, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
ui ✅ Ready (Inspect) Visit Preview Aug 1, 2023 10:47am

@nuxt-studio
Copy link

nuxt-studio bot commented Jul 31, 2023

Live Preview ready!

Name Edit Preview Latest Commit
ui Edit on Studio ↗︎ View Live Preview 131d821

@@ -29,11 +29,11 @@ async function submit () {
:state="state"
@submit.prevent="submit"
>
<UFormGroup label="Email" name="email-joi">
Copy link
Member

Choose a reason for hiding this comment

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

Indeed, I see the issue. I've updated this because it throws some duplicate ids warnings in the console.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok! Let's update the schema path then!

Copy link
Collaborator Author

@romhml romhml Aug 1, 2023

Choose a reason for hiding this comment

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

I looked into it, is it necessary to bind the name props to id on inputs?
https://github.com/nuxtlabs/ui/blob/dev/src/runtime/components/forms/Input.vue#L4

Copy link
Member

@benjamincanac benjamincanac Aug 1, 2023

Choose a reason for hiding this comment

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

Not really, it was just a shortcut to write less code. But removing it would cause a breaking change though.

Copy link
Member

Choose a reason for hiding this comment

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

Oh sorry, the id is here to be targeted by the FormGroup component through <label for="..." />, we can't remove it..

Copy link
Member

Choose a reason for hiding this comment

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

What can we do to fix this quickly? I plan to release the 2.7.0 today.

Copy link
Collaborator Author

@romhml romhml Aug 1, 2023

Choose a reason for hiding this comment

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

I changed the name attributes in the examples, should be good enough for now

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh sorry, the id is here to be targeted by the FormGroup component through , we can't remove it..

Could you send me a link to the code?

Copy link
Member

Choose a reason for hiding this comment

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

@benjamincanac benjamincanac merged commit 248b0a6 into nuxt:dev Aug 1, 2023
1 check passed
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