Submitting a form with focus on a select-input (dropdown) does not work with Return-Key
Categories
(Core :: DOM: Forms, defect, P3)
Tracking
()
| Accessibility Severity | s3 |
People
(Reporter: jn, Unassigned)
References
(Blocks 3 open bugs)
Details
(Keywords: access, parity-chrome, parity-safari)
Attachments
(1 file)
|
2.11 MB,
video/quicktime
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:89.0) Gecko/20100101 Firefox/89.0
Steps to reproduce:
Selecting an option of an HTML-Dropdown (via mouse or keyboard). After selecting an option, the selectbox is still focussed. The press the return-key.
Actual results:
Nothing.
Expected results:
The form should be submitted as it will submitted after using an text-inputfield.
Comment 1•4 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: Core & HTML' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
I don't know if the current behavior violates the specification, but at least Chrome doesn't submit the form either.
Don't know if this behaviour violates the specs too, but: in chrome it works. (I've attached a video)
(In reply to jn from comment #4)
Don't know if this behaviour violates the specs too, but: in chrome it works. (I've attached a video)
Oh, thanks. It seems you're using macOS, I tried only Ubuntu 20.04.
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select can be used to test the issue.
Oh, I'm really sorry for this bad bug-description.
Mac OS 10.15.7.
Chrome 91.0.4472.77 (worked the versions before too)
And: I switched to Firefox, and I'm gonna stay there. That's the reason why I've recognized this :) (The last FF update has been great, thanks)
Comment 8•4 years ago
|
||
Hello! Looked into this using the test case from comment 6 and Firefox 91.0a1 (20210607214637), and this happens as follows:
-
Ubuntu 18 -chrome -> pressing return key opens the dropdown
Nightly - Pressing return key - nothing happens -
Windows 10x64- chrome ->pressing return key opens the dropdown
Nightly - Pressing return key - nothing happens (same with 54.0a1 (20170202030211)) -
macOS M1 mini 11.3- chrome - pressing return key submits the selection
Nightly - pressing return key - nothing happens
I tried also searching for a regression range on macOS M1 mini 11.3 and I can reproduce the issue with Firefox 82.0a1 (2020-09-02) as well but unfortunately, I cannot open older builds because it crashes on the page from comment 6. @csasca will continue with the regression range. If more information is needed please let me know.
Comment 9•4 years ago
|
||
Continued the regression searching on macOS 10.15.7 but I was unable to find one. I was able to go way back to 30.0a1 (2014-03-05) and the issue still persists on the test page, while on 24.0a1 (2013-06-05) the test page will refuse to load at all.
(In reply to Catalin Sasca, QA [:csasca] from comment #9)
Continued the regression searching on macOS 10.15.7 but I was unable to find one. I was able to go way back to 30.0a1 (2014-03-05) and the issue still persists on the test page, while on 24.0a1 (2013-06-05) the test page will refuse to load at all.
jn, Catalin, Alexandru: thanks for the feedback.
So it's at least not a recent regression.
:atrif: can you check Safari's behavior too, please?
Comment 12•4 years ago
•
|
||
Safari seems that is submitting the form as well like Chrome does when using Enter key on macOS M1 mini 11.3.
(In reply to Alexandru Trif, QA [:atrif] from comment #12)
Safari seems that is submitting the form as well like Chrome does when using Enter key on macOS M1 mini 11.3.
:atrif: thanks.
This deserves further investigation to determine what the spec states and we should strive for web-compatibility.
| Reporter | ||
Comment 15•3 years ago
|
||
hi - any updates here? :)
According to https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#implicit-submission:concept-form-submit it's up to the user agent. However, since Chrome and Safari behave as the reporter expected, it seems reasonable for Firefox to behave the same. I don't see any concerns about this.
Masayuki: any concerns about this?
Comment 17•3 years ago
|
||
This seems more like a UX issue.
We have not identified any known websites breaking because of this, but please report if any live sites are affected and set the priority to P1 if high ranking.
Comment 18•3 years ago
|
||
Submitting form with an Enter key press is handled in HTMLInputEvent::PostHandleEvent. Probably this is the reason why Enter key press in <select> element does not work as submitting the form (HTMLSelectElement::PostHandleEvent handles only focus/blur events and there is no comment mentioning this issue around there).
It's no problem to make HTMLSelectElement handle Enter key press, I guess. However, from point of view of UX, I'm not sure it's better/worse behavior because the dropdown list can be closed by an Enter key press, this may cause users submitting the form unexpectedly if they accidentally press Enter twice or pressed long time. The latter could be avoided with checking mIsRepeat, but I'm not sure about the former.
And I guess that some DOM peers may have already discussed about this. So ccing some people who might know something.
| Reporter | ||
Comment 19•3 years ago
|
||
Hitting Enter closes the opened <select>, hitting the second time Enter submitting the form would be excpected.
Because: after the first Enter the <select> is closed AND in :focus. On a <input type="text" />, hitting enter would submit the form if a <input type="text" /> is in :focus .
For me it seems consistent to submit a focussed <select> same as a focussed <input type="text" />.
PS.: You can try this behaviour directy below this reply-form at the "Request inforation from ...." inputs ;-)
| Reporter | ||
Comment 20•2 years ago
|
||
I would like to push this topic to the top 🥹
Comment 21•1 year ago
|
||
Just tested Chrome again, it opens the dropdown when pressing return key on Linux, but submits the form on Mac.
I didn't test Windows, but per comment 8, it likely behave same as Linux.
Not sure if we would like to have consistent behavior cross platforms. And There is some concern on submitting form in comment 18.
It would be good to have some input from accessibility pointer of view.
:ayeddi, would you mind providing some insight here? Thanks!
| Reporter | ||
Comment 22•1 year ago
|
||
Firefox Windows: pressing "return key", nothing happens; pressing "space" -> select openes
Firefox Mac: pressing "return key", nothing happens; pressing "space" -> select openes
Chrome Windows: pressing "return key", openes the selectbox
Chrome Mac: pressing "return key", fires the form
Linux: not tested
That the inconsistency is only on chrome, I didn't realized.
My personal opinion: the select-item is an input field like the text-input field as well. So it should be fired by pressing return key, and it openes - as it is - after pressing spacebar.
Comment 23•1 year ago
|
||
After an internal discussion with :Jamie and :Gijs, the Accessibility team's recommendation would be to follow the OS convention (which would achieve the parity with Chrome, in this case):
- Windows and Linux - pressing
Returnkey opens the dropdown - macOS - pressing
Returnkey to submit the selection
I'll file a sibling bug to update Windows behavior as well.
| Reporter | ||
Comment 24•1 year ago
|
||
cool, thanks for the effort!
Description
•