Re: proposed change: links inside label elements

2014-01-14 12:56, Steve Faulkner wrote:
> What I have done is add a note in the spec about the positive effect 
> for usability/accessibility of labels as it increases hit area of the 
> labeled control, and that linking label text negates this.

Looks good. Well, the example looks a bit odd, since the <a> element 
inside a <label> element has been highlighted with yellow background. I 
am afraid this makes this look recommended, instead of the intended 
effect of indicating it as "marked" only. And since only  negative 
example is given, the question "well, what should I do instead?" is left 
in the air.

A link is actually just a special case. The <label> element might 
contain a link, without consisting of a link only, or it might contain 
something else that is "clickable" (disallowing labellable element 
forbids some clickable elements, but not all, e.g. a <details> element 
or a <span> with an onclick attribute).

Perhaps this point could be made clearer by using a more general 
formulation and by adding a positive example. After the current text 
"The ability to click or press a |label 
<http://www.w3.org/html/wg/drafts/html/master/single-page.html#the-label-element>| 
to trigger an event on a control provides usability and accessibility 
benefits by increasing the /hit area/ of a control. ", I would suggest:

This benefit may be lost or reduced, if the label element contains an 
element with its own activation behavior, such as a link:

[current example goes here]

The problem can usually be avoided by putting such elements after the 
<label> element, as an explanation:

<label><input type=checkbox name=found>found</label>
(see <a href="found.html">definition of "found"</a>)

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/

Received on Tuesday, 14 January 2014 11:34:38 UTC