This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27333 - Most user agents (Chrome, Firefox) seem to distinguish between space and enter. Enter submits the form, even for radio buttons, space selects the checkbox.
Summary: Most user agents (Chrome, Firefox) seem to distinguish between space and ente...
Status: RESOLVED MOVED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - UI Events (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Travis Leithead [MSFT]
QA Contact: public-webapps-bugzilla
URL: https://html.spec.whatwg.org/#file-up...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-15 06:16 UTC by contributor
Modified: 2015-10-07 04:24 UTC (History)
6 users (show)

See Also:


Attachments

Description contributor 2014-11-15 06:16:06 UTC
Specification: https://html.spec.whatwg.org/multipage/forms.html
Multipage: https://html.spec.whatwg.org/multipage/#file-upload-state-(type=file)
Complete: https://html.spec.whatwg.org/#file-upload-state-(type=file)
Referrer: https://html.spec.whatwg.org/multipage/interaction.html

Comment:
Most user agents (Chrome, Firefox) seem to distinguish between space and
enter. Enter submits the form, even for radio buttons, space selects the
checkbox.

Should the spec be updated for this?

(Additionally, it's not very clear in the spec the different ways in which an
element can be activated)

Posted from: 103.21.125.76
User agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0
Comment 1 Manish Goregaokar 2014-11-15 06:17:35 UTC
(Submitter here)

The correct spec link is https://html.spec.whatwg.org/multipage/forms.html#radio-button-state-%28type=radio%29, though there are similar issues throughout the spec.
Comment 2 Ian 'Hixie' Hickson 2014-11-19 22:09:35 UTC
This is mostly up to the browser. That it is possible for "enter" to submit the form is described here:

   https://html.spec.whatwg.org/multipage/#implicit-submission

...but I don't know what else we can say. We can't say "space selects, enter submits", because what if the browser doesn't have a keyboard? Or has two "enter" keys? Or wants space bar to page down, and "x" to select?
Comment 3 Manish Goregaokar 2014-11-20 03:52:13 UTC
So we only consider hitting theenter key as activation? This seems to say differently: 

https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#event-type-keydown

> If the key is the 'Enter' or ' ' key and the current focus is on a state-changing element, the default action MUST be to dispatch a click event, and a DOMActivate event if that event type is supported by the user agent (refer to activation triggers and behavior for more details)


So this means that ' ' and 'Enter' should activate -- however as defined in the spec, activation means selection for a checkbox, which deviates from the spec.

I'm not even sure if 'Enter' should be triggering a click event.
Comment 4 Ian 'Hixie' Hickson 2014-11-20 18:17:48 UTC
That sounds like a problem with the DOM3 Events spec.
Comment 5 Manish Goregaokar 2014-11-20 18:22:48 UTC
Moving over to DOM3 as per Hixie's comment
Comment 6 Arthur Barstow 2015-03-21 15:11:56 UTC
Bulk move of all D3E bugs to the UI Events component.
Comment 7 Gary Kacmarcik 2015-10-07 04:24:15 UTC
Now tracking as: https://github.com/w3c/uievents/issues/33