Open Bug 1715027 Opened 4 years ago Updated 1 year ago

Submitting a form with focus on a select-input (dropdown) does not work with Return-Key

Categories

(Core :: DOM: Forms, defect, P3)

Firefox 89
Unspecified
macOS
defect

Tracking

()

Accessibility Severity s3

People

(Reporter: jn, Unassigned)

References

(Blocks 3 open bugs)

Details

(Keywords: access, parity-chrome, parity-safari)

Attachments

(1 file)

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.

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.

Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core

I don't know if the current behavior violates the specification, but at least Chrome doesn't submit the form either.

Severity: -- → S3
Component: DOM: Core & HTML → DOM: Forms
Priority: -- → P3

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.

Severity: S3 → --
Keywords: parity-chrome
Priority: P3 → --

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)

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.

Flags: needinfo?(catalin.sasca)

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.

Flags: needinfo?(catalin.sasca)

(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.

Status: UNCONFIRMED → NEW
Type: enhancement → defect
Ever confirmed: true
OS: Unspecified → macOS

:atrif: can you check Safari's behavior too, please?

Flags: needinfo?(alexandru.trif)

Safari seems that is submitting the form as well like Chrome does when using Enter key on macOS M1 mini 11.3.

Flags: needinfo?(alexandru.trif)

(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.

Keywords: parity-safari

This deserves further investigation to determine what the spec states and we should strive for web-compatibility.

Severity: -- → S3
Priority: -- → P3

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?

Flags: needinfo?(masayuki)

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.

Webcompat Priority: ? → ---

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.

Flags: needinfo?(masayuki)

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 ;-)

I would like to push this topic to the top 🥹

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!

Flags: needinfo?(ayeddi)

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.

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 Return key opens the dropdown
  • macOS - pressing Return key to submit the selection

I'll file a sibling bug to update Windows behavior as well.

Flags: needinfo?(ayeddi)

cool, thanks for the effort!

Blocks: 1912527
Blocks: 1912528
Blocks: 1912304
Accessibility Severity: --- → s3
Keywords: access
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: