Closed Bug 1799643 Opened 3 years ago Closed 3 years ago

input type=file cancel event

Categories

(Core :: DOM: Events, defect)

Firefox 106
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: prr, Unassigned)

References

Details

Attachments

(1 file)

Attached file test.html

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0

Steps to reproduce:

<input type="file"> fires undocumented event "cancel" that propagates up to root and causes lot of confusion.

Actual results:

  • Page displays "dialog was cancelled" and "Wasn't expecting that!"

Expected results:

  • Page should not display neither of these texts.

Technically:

  • the cancel event of input type=text should be documented
  • the cancel event of the input should not propagate up in DOM

Reproes on FF 106 @Mac and FF 105 @Windows
Works correctly in FF 88 @Linux

The Bugbug bot thinks this bug should belong to the 'Core::Layout: Form Controls' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Layout: Form Controls
Product: Firefox → Core

The event is standard: https://html.spec.whatwg.org/#show-the-picker,-if-applicable

It's defined as bubbles=true, so this is a documentation issue only.

Component: Layout: Form Controls → DOM: Events
See Also: → 1719703

OK, so the solution is implemented to the spec...
I predict it will cause lot of confusion when dialogs will get more real life use and I have trouble understanding why bubbles=true was chosen to be used here. For example, dialog's cancel does not propagate, which sounds much more reasonable choice.

If possible, please kindly forward this feedback to whoever is responsible for the spec.
And please update the MDN on input type=file.
Thank you.

IIUC, we can close this as INVALID.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: