-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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(checkbox): Chakra Checkbox HTML Validation fix #3364
Conversation
When validating the Chakra checkbox element in the w3 HTML validator an error for each rendered checkbox comes up: "Element div not allowed as child of element label in this context. (Suppressing further errors from this subtree.)" because each StyledContainer <label> contains a StyledControl <div> and a "chakra-checkb-x__label" <div>. This is causing errors in my project which requires that I have 0 errors when my HTML is validated, so I would like to propose that these <div> elements are converted to <span> elements to resolve the issue.
🦋 Changeset detectedLatest commit: b99b867 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/chakra-ui/chakra-ui/hzoorz6s3 |
This pull request introduces 1 alert when merging 7b1c468 into 8fdca9b - view on LGTM.com new alerts:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! 👌
Deployment failed with the following error:
|
Closes #3363
📝 Description
When validating the Chakra checkbox element in the w3 HTML validator an error for each rendered checkbox comes up: "Element div not allowed as child of element label in this context. (Suppressing further errors from this subtree.)" because each StyledContainer
<label>
contains a StyledControl<div>
and a "chakra-checkbox__label"<div>
. This is causing errors in my project which requires that I have 0 errors when my HTML is validated, so I would like to propose that these<div>
elements are converted to<span>
elements to resolve the issue.⛳️ Current behavior (updates)
StyledControl is a
<div>
, so is "chakra-checkbox__label"🚀 New behavior
Changing those 2 elements to
<span>
s instead.💣 Is this a breaking change (Yes/No):
No
📝 Additional Information