Closed Bug 265576 Opened 21 years ago Closed 20 years ago

Invalid action when pressing enter in html file input field

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 252526

People

(Reporter: marcin.kowalski, Assigned: bugzilla)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1 Pressing Enter on "Browse" button in <input type="file" .... /> causes FF first to show file request and second, to submit form data in one action. Additionaly it's possible to open file selector while waiting for response from http server after clicking somewhere on page. User ends up with file selector on another subpage. Reproducible: Always Steps to Reproduce: 1. Using tab set focus on "Browse" button in <input type="file" ... /> 2. Press enter Actual Results: File selector opens, but form is submited too. Expected Results: Do not submit form.
Not sure if this means it regressed on the branch, or was fixed on the trunk by something I can't find, but confirmed in Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20041021 Firefox/1.0, while Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a5) Gecko/20041018 Firefox/0.9.1+ does the right thing and doesn't submit on pressing enter on a Browse button.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Mozilla 1.3 - 1.6 also behave correctly. (I got lazy and didn't check 1.0 - 1.2, but I imagine they're OK.)
With 1.8a6, pressing Enter while the focus is in the file input's text box triggers the bug. (This is also true with 1.7 and FF 1.0.) The bug is therefore only partially fixed in 1.8a6, unless this behavior qualifies as a separate bug. For what it's worth, the form's submit handler gets called, but does not run to completion before the form is submitted. (Or maybe any requests to prevent the event's default action are ignored.) In any case, it cannot prevent the submission.
I should have reread that last comment more closely before submitting. By "triggers this bug," I mean that pressing Enter when the focus is in the file input control's text box causes the form to be submitted. No file picker comes up. (That, at least, is a good thing.) Sorry for the bugspam.
Submitting from enter in the input's text field was intentional, in bug 111689, and then submitting from enter on the Browse button came back out in bug 252526. *** This bug has been marked as a duplicate of 252526 ***
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: