Skip to content

Form control has label 924 #975

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

Merged
merged 4 commits into from
Jan 16, 2024
Merged

Form control has label 924 #975

merged 4 commits into from
Jan 16, 2024

Conversation

vhoyer
Copy link
Collaborator

@vhoyer vhoyer commented Dec 5, 2023

I'm not entirely happy with this, anyone want to give opinions and suggestions?

@@ -5,8 +5,22 @@ makeRuleTester("form-control-has-label", rule, {
valid: [
"<label for=''><input type='text' /></label>",
Copy link

@jashaj jashaj Dec 6, 2023

Choose a reason for hiding this comment

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

Not related to the original issue I had filed, but this line doesn't pass HTML validation:

  1. An empty string is not allowed for for
  2. If label has a for attribute, the nested form control (input). must have an id that matches the value of for.

It's also questionable if a label without text should pass.

@vhoyer vhoyer force-pushed the form-control-has-label-924 branch from dfe680b to d41b34a Compare January 16, 2024 14:01
@vhoyer vhoyer merged commit 77ffeac into main Jan 16, 2024
@vhoyer vhoyer deleted the form-control-has-label-924 branch January 16, 2024 18:30
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