[whatwg] LABEL and radio/checkbox onclick
Matthew Thomas
mpt at myrealbox.com
Sun Jul 18 09:44:42 PDT 2004
On 19 Jul, 2004, at 3:17 AM, Matthew Raymond wrote:
> ...
> The W3C HTML 4.01 specification makes it pretty clear that a label
> passes focus to the control with which it is associated.
The W3C is frequently wrong about UI details. Here, for example,
firstly they failed to recognize that in native applications on any
platform, clicking the label for a listbox (aka <select multiple>) or
text field will not focus the field.
Secondly, they failed to recognize that in all extant versions of Mac
OS, most native controls (including checkboxes, radio buttons, and
option menus) could *never* be focused, even when you clicked on them.
The same is true even in OS X, unless you have "Full Keyboard Access"
turned on, which most people don't since it's (a) off by default and
(b) intended for disabled people. (Apple's designers judge, probably
correctly, that non-disabled people are faster overall if focus is
confined to controls for which text input is actually useful.)
> As a result, I think it should always be the case that clicking the
> label gives the associated control focus.
As described above, that makes no sense for most OS X users.
> If web authors don't want this to be the case, they should just use
> text instead of <label>.
That doesn't produce the desired result if I style <label> (for
example, label {font-family: sans-serif}), but I don't want labels to
act weirdly (passing focus in a way that labels in native applications
do not).
I could use <label> to label checkboxes and radiobuttons, and <span
class="label"> to label every other kind of control, to make the labels
behave properly, and then style both elements, but having to do that to
work around a bug in the spec would be pretty annoying.
Therefore, my suggestion stands.
--
Matthew Thomas
http://mpt.net.nz/
More information about the whatwg
mailing list