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

Event documentation no longer depicts "bubbles" information. #22198

Closed
theengineear opened this issue Nov 9, 2022 · 5 comments
Closed

Event documentation no longer depicts "bubbles" information. #22198

theengineear opened this issue Nov 9, 2022 · 5 comments
Labels
Content:WebAPI Web API docs

Comments

@theengineear
Copy link

MDN URL

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

What specific section or headline is this issue about?

Information about EventInit flags

What information was incorrect, unhelpful, or incomplete?

MDN used to have information about event bubbles front-and-center. This is one of the main reasons I look at documentation on events as a developer. In particular, when dealing with form nuance — it's easy to forget whether things like change or input or invalid bubble.

Thanks very much for your consideration!

What did you expect to see?

I expect to see a flag depicting whether or not the event bubbles. Here's a screen grab from the way back machine. Here's the live link as well: https://web.archive.org/web/20210225074714/https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event

Screenshot 2022-11-09 at 9 07 10 AM

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

Previous rendering of an example page: https://web.archive.org/web/20210225074714/https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@github-actions github-actions bot added needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. Content:WebAPI Web API docs labels Nov 9, 2022
@sideshowbarker sideshowbarker removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Nov 10, 2022
@Josh-Cena
Copy link
Member

cc @queengooborg

@queengooborg
Copy link
Collaborator

Hey @theengineear -- during the migration to a new page layout for event pages, we removed those tables as we merged the information into the writing itself. If an event is cancellable or does not bubble, you will now see a line near the top that says "This event is not cancellable" or "This event does not bubble". In other words, the information has not been removed, it's just represented in a different form.

Hope this helps!

@theengineear
Copy link
Author

Thanks for the explainer @queengooborg. Having that information in the prose is totally fine by me. However, when I search “bubble” on that page, I don't see anything come up. Am I missing something? To be really clear, I'm talking about this page in particular: https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event

@hamishwillee
Copy link
Collaborator

That would mean that this event bubbles and is cancellable - do you know different?

FWIW @queengooborg I question the decision to move into prose - the reason being that before we knew the states - but now we could just have omitted information. Further, if this information can be extracted from IDL we could automate populating this, and if not, we could have as metadata.

@theengineear
Copy link
Author

The invalid event does not bubble. In the screen recording (from Chrome) the logs indicate that the event is being fired on the input element during constraint validation and the delegated event listener on the parent form never hears it.

invalid-event-demo

You can test this out with the following html file:

<!doctype html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>invalid event demo</title>
  </head>
  <body>
    <form id="form">
      <input id="input" name="input" required/>
      <input type="submit"/>
      <pre id="log"></pre>
    </form>
  </body>
  <script>
    const form = document.getElementById('form');
    const input = document.getElementById('input');
    const log = document.getElementById('log');
    form.addEventListener('submit', event => {
      event.preventDefault();
      log.textContent += 'form::submit\n';
    });
    form.addEventListener('invalid', () => {
      log.textContent += 'form::invalid\n';
    });
    input.addEventListener('invalid', () => {
      log.textContent += 'input::invalid\n';
    });
  </script>
</html>

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Content:WebAPI Web API docs
Projects
None yet
Development

No branches or pull requests

5 participants