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(820): label has associated control #5074

Merged
merged 2 commits into from
Aug 5, 2020
Merged

fix(820): label has associated control #5074

merged 2 commits into from
Aug 5, 2020

Conversation

skippednote
Copy link
Contributor

For #820
Because label-has-for has been deprecated I have instead implemented label-has-associated-control.

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR relates to an outstanding issue, so please reference it in your PR, or create an explanatory one for discussion. In many cases, features are absent for a reason.
  • This message body should clearly illustrate what problems it solves. If there are related issues, remember to reference them.
  • Ideally, include a test that fails without this PR but passes with it. PRs will only be merged once they pass CI. (Remember to npm run lint!)

Tests

  • Run the tests with npm test or yarn test)

@PatrickG
Copy link
Member

input is not the only labelable element.
See https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Form_labelable

@skippednote
Copy link
Contributor Author

Thanks @PatrickG, I'm checking for all labelable items now.

@Conduitry Conduitry merged commit 62ab75e into sveltejs:master Aug 5, 2020
@Conduitry
Copy link
Member

This is warning is included in 3.24.1.

taylorzane pushed a commit to taylorzane/svelte that referenced this pull request Dec 17, 2020
@@ -507,6 +518,16 @@ export default class Element extends Node {
}
}

if (this.name === 'label') {
const has_input_child = this.children.some(i => (i instanceof Element && a11y_labelable.has(i.name) ));

Choose a reason for hiding this comment

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

This ignores the possibility of elements having the role attribure.

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.

4 participants