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

Back button not working #93

Open
Shadowfaxenator opened this issue Sep 4, 2024 · 1 comment
Open

Back button not working #93

Shadowfaxenator opened this issue Sep 4, 2024 · 1 comment

Comments

@Shadowfaxenator
Copy link

I add a x-target.push url changes, but state is not saved in a history when making page navigation. How can I solve it?

@imacrayon
Copy link
Owner

Hey, thanks for bringing this to my attention. We used to trigger a page reload when navigating through history, but it looks like that got dropped in in v0.6. Anyway I think a more comprehensive solution is probably necessary now, I'll try to get something pushing in the next few days. In the meantime, you should be able to add the old v0.5 behavior back to your project with this event listener:

window.addEventListener('popstate', (e) => {
  if (!e.state || !e.state.__ajax) return

  window.location.reload(true)
})

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

2 participants