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

A11y: A form label must be associated with a control #209

Closed
awhitford opened this issue Dec 28, 2020 · 2 comments
Closed

A11y: A form label must be associated with a control #209

awhitford opened this issue Dec 28, 2020 · 2 comments

Comments

@awhitford
Copy link
Contributor

awhitford commented Dec 28, 2020

I noticed these compilation issues:

(!) Plugin svelte: A11y: A form label must be associated with a control.
node_modules/smelte/src/components/Checkbox/Label.svelte
20: </script>
21: 
22: <label
    ^
23:   aria-hidden="true"
24:   {...$$props}
node_modules/smelte/src/components/Slider/Slider.svelte
52: </script>
53: 
54: <label>{label}</label>
    ^
55: <input
56:   use:applyColor
node_modules/smelte/src/components/Switch/Switch.svelte
67:     </Ripple>
68:   </div>
69:   <label aria-hidden="true" class={l}>
      ^
70:     {label}
71:   </label>
node_modules/smelte/src/components/TextField/Label.svelte
73: </style>
74: 
75: <label class="{lClasses} {$$props.class}" {...props}>
    ^
76:   <slot />
77: </label>
created public/build/bundle.js in 5s

I think the fundamental complaint from A11y is that the label tags have no for attribute.

@awhitford
Copy link
Contributor Author

According to this answer, you can just put the <input> inside the <label>, then no id/for is needed -- which is I think what Smelte is doing. As a result, this looks like a false alarm. Looks related to sveltejs/svelte#5528

@awhitford
Copy link
Contributor Author

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

No branches or pull requests

1 participant