- From: Gary Kacmarcik <notifications@github.com>
- Date: Tue, 06 Oct 2015 21:23:59 -0700
- To: w3c/uievents <uievents@noreply.github.com>
- Message-ID: <w3c/uievents/issues/33@github.com>
Original title: Most user agents (Chrome, Firefox) seem to distinguish between space and enter. Enter submits the form, even for radio buttons, space selects the checkbox Copied from W3C Bugzilla: https://www.w3.org/Bugs/Public/show_bug.cgi?id=27333 ##### contributor@whatwg.org 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. --- Reply to this email directly or view it on GitHub: https://github.com/w3c/uievents/issues/33
Received on Wednesday, 7 October 2015 04:24:36 UTC