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(checkbox): Chakra Checkbox HTML Validation fix #3364

Merged
merged 3 commits into from
Feb 12, 2021

Conversation

grahhham
Copy link
Contributor

@grahhham grahhham commented Feb 11, 2021

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

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-bot
Copy link

changeset-bot bot commented Feb 11, 2021

🦋 Changeset detected

Latest commit: b99b867

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@chakra-ui/checkbox Patch
@chakra-ui/react Patch
@chakra-ui/switch Patch
@chakra-ui/test-utils Patch
chakra-cra Patch
gatsby-starter-default Patch
chakra-nextjs Patch
chakra-nextjs-ts Patch
@chakra-ui/props-docs Patch
@chakra-ui/docs Patch

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

@vercel
Copy link

vercel bot commented Feb 11, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/chakra-ui/chakra-ui/hzoorz6s3
✅ Preview: https://chakra-ui-git-fork-grahhham-patch-1.chakra-ui.vercel.app

@lgtm-com
Copy link

lgtm-com bot commented Feb 11, 2021

This pull request introduces 1 alert when merging 7b1c468 into 8fdca9b - view on LGTM.com

new alerts:

  • 1 for Syntax error

Copy link
Member

@segunadebayo segunadebayo left a comment

Choose a reason for hiding this comment

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

Good catch! 👌

@segunadebayo segunadebayo merged commit 831cb71 into chakra-ui:main Feb 12, 2021
@github-actions github-actions bot mentioned this pull request Feb 12, 2021
@vercel
Copy link

vercel bot commented Feb 12, 2021

Deployment failed with the following error:

Creating the Deployment Timed Out.

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.

fix(checkbox): Chakra Checkbox HTML Validation bug
2 participants