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

Unpoly Links + Browser Back Button not triggering replace #39

Closed
jakedowns opened this issue Nov 28, 2017 · 2 comments
Closed

Unpoly Links + Browser Back Button not triggering replace #39

jakedowns opened this issue Nov 28, 2017 · 2 comments

Comments

@jakedowns
Copy link

jakedowns commented Nov 28, 2017

using latest unpoly release unpoly@0.37.0
and jquery 2.2.4

I have some up-target / up-dash links which correctly insert a history object into the browser's history stack when followed, but when i push the browser's back button (chrome) up:history:restored is never emitted

when i bind my own listener to window.popstate and inspect e.originalEvent.state is appears the state.fromUp flag property is missing

[UP] Ignoring a state not pushed by Unpoly

even when i explicitly set up-history attributes on the links

i'll work on putting together a reduced test case...

@jakedowns
Copy link
Author

hrm... works in reduced test case, i must have some other conflicting code.
closing.

@jakedowns
Copy link
Author

Update: I was clobbering window.history.state.fromUp with my own history.replaceState when removing utm parameters from the address bar

checking for and retaining .fromUp flag resolved the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant