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

pushState does NOT fire popstate #30178

Closed
Tracked by #30186
mtkopone opened this issue Nov 10, 2023 · 2 comments
Closed
Tracked by #30186

pushState does NOT fire popstate #30178

mtkopone opened this issue Nov 10, 2023 · 2 comments
Labels
Content:WebAPI Web API docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.

Comments

@mtkopone
Copy link

mtkopone commented Nov 10, 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: "Add a listener for the popstate event in order to determine when the navigation has completed. The state parameter will be available in it."

Yet the popState page (https://developer.mozilla.org/en-US/docs/Web/API/Window/popstate_event) says: Note that just calling history.pushState() or history.replaceState() won't trigger a popstate event. The popstate event will be triggered by doing a browser action such as a click on the back or forward button (or calling history.back() or history.forward() in JavaScript).

_

What did you expect to see?

I'd expect it to say e.g. "You cannot listen for state changes using popstate, so maybe you should reconsider your entire approach."

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

No response

Do you have anything more you want to share?

No response

MDN metadata

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

Thanks for filing! I closed this yesterday in #30169, and the fix should be live on the site in the next few hours.

@mtkopone
Copy link
Author

Thx!

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

No branches or pull requests

2 participants