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

Conflicting documentation about pushState and the popState event #30168

Closed
Mossop opened this issue Nov 9, 2023 · 1 comment · Fixed by #30169
Closed

Conflicting documentation about pushState and the popState event #30168

Mossop opened this issue Nov 9, 2023 · 1 comment · Fixed by #30169
Labels
Content:WebAPI Web API docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.

Comments

@Mossop
Copy link

Mossop commented Nov 9, 2023

MDN URL

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

What specific section or headline is this issue about?

History: pushState() method

What information was incorrect, unhelpful, or incomplete?

The page says:

This method is asynchronous. Add a listener for the popstate event in order to determine when the navigation has completed. The state parameter will be available in it

But over on the docs for popstate it says:

Note that just calling history.pushState() or history.replaceState() won't trigger a popstate event.

What did you expect to see?

The two pages should agree on whether calling pushState triggers a popstate event or not (I don't think it does).

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

No response

Do you have anything more you want to share?

No response

@Mossop Mossop added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Nov 9, 2023
@github-actions github-actions bot added the Content:WebAPI Web API docs label Nov 9, 2023
@wbamberg
Copy link
Collaborator

wbamberg commented Nov 9, 2023

This is a duplicate of #30014 - as I commented there, yes, I also think pushState does not trigger a popstate event.

Oh and also #25785.

I'll file a PR to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants