Skip to content
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

No information about "cancel" event on HTMLInputElement page #31014

Closed
Cipscis opened this issue Dec 15, 2023 · 12 comments · Fixed by #36439
Closed

No information about "cancel" event on HTMLInputElement page #31014

Cipscis opened this issue Dec 15, 2023 · 12 comments · Fixed by #36439
Labels
Content:WebAPI Web API docs goal: accuracy (Experimental label) Issues about inaccurate/incorrect content.

Comments

@Cipscis
Copy link

Cipscis commented Dec 15, 2023

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement

What specific section or headline is this issue about?

Events

What information was incorrect, unhelpful, or incomplete?

The "cancel" event for the HTMLInputElement, which is fired when a picker for an input element with type "file" is cancelled without the value being changed, is not mentioned anywhere on the HTMLInputElement page.

What did you expect to see?

The HTMLInputElement page should mention the "cancel" event, and link to its documentation.

Do you have any supporting links, references, or citations?

The "cancel" event for <input type="file"> elements was added to the HTML standard in July 2021: whatwg/html#6735

HTML spec - cancel event
HTML spec - Common input element APIs

This feature has been supported by all modern browsers since May 2023. According to CanIUse, it currently has 83.62% global browser support. Support for this feature is already included in mdn/browser-compat-data and displays on the HTMLInputElement page.

Do you have anything more you want to share?

No response

@Cipscis Cipscis added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Dec 15, 2023
@github-actions github-actions bot added the Content:WebAPI Web API docs label Dec 15, 2023
@caugner caugner added the goal: completeness (Experiment label) Issues about content missing important/relevant details. label Dec 18, 2023
@bsmth
Copy link
Member

bsmth commented Jan 24, 2024

As far as I remember, this is under https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/cancel_event

HTMLElement instead of specifically HTMLInputElement, although BCD puts it under HTMLInputElement: https://github.com/ntdiary/browser-compat-data/blob/main/api/HTMLInputElement.json#L201-L239

@bsmth bsmth added goal: accuracy (Experimental label) Issues about inaccurate/incorrect content. and removed goal: completeness (Experiment label) Issues about content missing important/relevant details. labels Jan 24, 2024
@bsmth
Copy link
Member

bsmth commented Jan 24, 2024

Indeed, there's a larger discussion about where this should live in #30946

@bsmth bsmth added needs decision The task needs consensus through discussion and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Jan 24, 2024
@dipikabh
Copy link
Contributor

Related issue on BCD open here: mdn/browser-compat-data#21585

@dipikabh
Copy link
Contributor

Hello @Cipscis, pinging to check if you'd be interested in opening a PR as per the approach proposed in #30946 (comment).

@dipikabh dipikabh added the awaiting response Awaiting for author to address review/feedback label Jan 30, 2024
@skyclouds2001
Copy link
Contributor

skyclouds2001 commented Jan 30, 2024

I notice #29639, which tend to add the cancel event to <input> element, where move the cancel event from HTMLDialogElement to HTMLElement

This might be a unexpected fix and lack of discussion

@Josh-Cena
Copy link
Member

Related: #31910

@Josh-Cena Josh-Cena removed the awaiting response Awaiting for author to address review/feedback label Jun 11, 2024
@Josh-Cena Josh-Cena removed the needs decision The task needs consensus through discussion label Jul 3, 2024
@Josh-Cena
Copy link
Member

So is the conclusion to keep the page at HTMLElement? I'm not sure what the conclusion is or if we reached one.

@dipikabh
Copy link
Contributor

dipikabh commented Jul 8, 2024

The conclusion from #30946 was to keep the event with the defining interface HTMLElement.

I agree with the proposal in #30946 (comment), that is:

  • Just like on the <video> page, add Events tables to <input> and <dialog> pages.

  • Add links on HTMLInputElement and HTMLDialogElement pages to the cancel event, describing when it is fired. Readers are often looking for the event info on these subclasses.

    For example, the cancel event info has been added to the <input type="file"> page via pull/29639. Similar info or links need to be added to HTMLInputElement and HTMLDialogElement pages for improving discoverability.

@Josh-Cena
Copy link
Member

I'm not entirely sure if documenting events in the HTML reference is a good idea since you are almost always listening for events in JS instead of HTML, but if we already have that precedent it sounds reasonable.

@Josh-Cena
Copy link
Member

Josh-Cena commented Jul 26, 2024

I, by chance, cycled back to this issue. I strongly believe the page move in #29639 should be reverted and we should have separate cancel pages for HTMLInputElement and HTMLDiaglogElement. They have entirely different firing conditions and behaviors, causing issues such as #31910. They even have separate BCD entries. I don't see reasons to conflate them.

@FurryR
Copy link
Contributor

FurryR commented Sep 27, 2024

👍 Agree. I think I've made a mistake, therefore we do really need these two pages to be separated.

@skyclouds2001
Copy link
Contributor

skyclouds2001 commented Oct 10, 2024

my research is as follows:

  • HTMLInputElement (type = 'file')

    • fired when user does not change file selection
    • bubble = true
    • cancelable = false

image

  • HTMLDialogElement

    • fired when dialog close
    • bubble = false
    • cancelable = true

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs goal: accuracy (Experimental label) Issues about inaccurate/incorrect content.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants