Skip to content

Chrome reports the FormField label as Incorrect use of <label for=FORM_ELEMENT> when wrapping RadioGroup or CheckboxGroup #3998

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

Open
TribeWeb opened this issue Apr 27, 2025 · 1 comment
Assignees
Labels
bug Something isn't working triage v3 #1289

Comments

@TribeWeb
Copy link
Contributor

TribeWeb commented Apr 27, 2025

Environment

  • Operating System: Darwin
  • Node Version: v22.13.0
  • Nuxt Version: 3.16.2
  • CLI Version: 3.24.0
  • Nitro Version: 2.11.8
  • Package Manager: pnpm@10.9.0
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Is this bug related to Nuxt or Vue?

Nuxt

Version

nuxt-ui 3.1.0

Reproduction

https://ui.nuxt.com/components/form

Open in Chrome and check issues in devtools. The linked erroring nodes are all RadioGroups or CheckboxGroups.

Description

The FormField component correctly removes the for attribute from the label for the RadioGroup & CheckboxGroup components. Chrome devtools would suggest that there should be a further step so that <label> is not used at all in this context.

I am happy to propose changes.

Image

Additional context

No response

Logs

@TribeWeb TribeWeb added bug Something isn't working triage v3 #1289 labels Apr 27, 2025
@TribeWeb
Copy link
Contributor Author

Update:
I have a simple fix that works fine for RadioGroup - but on closer inspection, it would seem that CheckboxGroup is not working as designed. Although opts: { bind: false } is working as expected, there is something else going on that means the FormField label actually has a for="{id}" attribute when it shouldn't (it's also passing the test when it shouldn't)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage v3 #1289
Projects
None yet
Development

No branches or pull requests

2 participants