input type=file cancel event
Categories
(Core :: DOM: Events, defect)
Tracking
()
People
(Reporter: prr, Unassigned)
References
Details
Attachments
(1 file)
|
1.43 KB,
text/html
|
Details |
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.
- Open attached test.html The base for the test case is copied from https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/cancel_event
- Click "Open dialog"
- Press Escape
- Page displays "dialog was cancelled" (as expected)
- Click "Open dialog"
- Click "Browse" on file input
- Press Escape or click Cancel button
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
Comment 2•3 years ago
|
||
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.
Comment 3•3 years ago
|
||
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.
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.
Comment 5•3 years ago
|
||
MDN issue: https://github.com/mdn/content/issues/22157
Comment 6•3 years ago
|
||
IIUC, we can close this as INVALID.
Description
•