-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Activation behavior of label elements pointing to form-associated custom elements #5009
Comments
As opposed to |
Suggest as a start all elements with roles that match labelable element roles are treated the same as the native labelled elements in respect to how an associated |
I think the spec's current intent may still apply to FACEs. It kind of depends on what the actual variance in platform behavior is, but my read is that UAs would use the spec's flexibility to have no activation behavior at all, not to toggle it on a per-element-type basis. Stated another way, I suspect that all UAs treat all labelable elements the same way, and so the behavior will fall out pretty naturally from the fact that FACEs are labelable elements. |
That's somewhat fair, I guess I'd appreciate an explicit note about FACEs. |
We could also do some testing to make sure my suspicions are correct, and if they are, perhaps tighten up the spec's requirements a bit, to make it fall out more obviously. But perhaps tightening up requirements is a bad idea here since the full range of ways that a UA might want to help users is probably best left up to the UA and the user's individual situation. So for now I'll say that the way to resolve this is to add a note to https://html.spec.whatwg.org/multipage/forms.html#the-label-element after the current text of
which says something like
and maybe expand the "For example, on platforms where clicking a checkbox label checks the checkbox" example with a custom element code snippet that exemplifies the parallel. |
One other thing is that |
For existing controls the behavior of the
label
element depends on the platform. This is not an option for form-associated custom elements since the platform has no idea what kind of controls they represent.So we need to decide what activating a
label
element means when it is associated with a form-associated custom element. Always forwarding aclick
event seems somewhat reasonable?cc @whatwg/a11y @muan @rakina
The text was updated successfully, but these errors were encountered: