-
Notifications
You must be signed in to change notification settings - Fork 22.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Add missing cancel
event to <input type=file>
#29639
Conversation
https://html.spec.whatwg.org/multipage/indices.html#event-cancel: Fired at dialog elements when they are canceled by the user (e.g., by pressing the Escape key), or at input elements in the File state when the user does not change their selection
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Preview URLs (7 pages)Flaws (9)Note! 4 documents with no flaws that don't need to be listed. 🎉 URL:
URL:
URL:
(comment last updated: 2023-11-20 14:54:46) |
Before adding a link to the cancel event in the technical summary, the page needs to be created. See my comment in the issue |
Sorry for replying so late, I will create the page later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made some suggested edits. I think we need to be clearer about the multiple ways the cancel event may be thrown.
Co-authored-by: Estelle Weyl <[email protected]>
Co-authored-by: Estelle Weyl <[email protected]>
Co-authored-by: Estelle Weyl <[email protected]>
Co-authored-by: Estelle Weyl <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the behavior of reselecting the same files unexpected, so want to make sure that it's clear. I made two suggestions to emphasize that. I am not sure if my suggestions are overkill.
also, when you're ready for a re-review, click the little icon next to my name so that you see a small brown dot instead of the icon. This informs me that the PR is ready for re-review.
Co-authored-by: Estelle Weyl <[email protected]>
Co-authored-by: Estelle Weyl <[email protected]>
This comment was marked as spam.
This comment was marked as spam.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THank you!
I think instead of moving page from |
* Revert ":bug: Add missing `cancel` event to `<input type=file>` (#29639)" This reverts commit 0900a56. * update & finish docs * Update files/en-us/web/api/htmlinputelement/cancel_event/index.md Co-authored-by: Joshua Chen <[email protected]> --------- Co-authored-by: Estelle Weyl <[email protected]> Co-authored-by: Joshua Chen <[email protected]>
Description
Add
cancel
event to<input type=file>
.Motivation
👎 People are using hacks (
window.addEventListener('focus')
) to detect cancellations of file dialogs.An example from GoogleChromeLabs/browser-fs-access
However, in https://html.spec.whatwg.org/multipage/indices.html#event-cancel:
It helps a lot.
Additional details
Reference: https://html.spec.whatwg.org/multipage/indices.html#event-cancel
Related issues and pull requests
🔨 Fixes #22157.