Using native javascript window.history.pushState but getting issue with Back button behaviour #1809
-
Hi there, I have a case where I have a Kanban style board view, and as the user clicks on different cards in the view, it opens up the details of the card in a sidebar. As the user clicks I am manually updating the url using My issue is that if the user then clicks on an Inertia Example
I do not want to use the Inertia router, as when I do router.visit it reloads all the tasks on the page, since I load them after the page loads so the initial page doesn't have to wait for all the tasks to load. I should be able to simply use pushState myself, but it seems like it's not loading that change into Inertia's own history. Cheers |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
use 'replaceState' instead of pushState |
Beta Was this translation helpful? Give feedback.
-
I ran into a similar issue. It appears in order for Inertia to remember the state of the URL you have to use their Link or router. Here's what I ended up with to mimic
I feel like they need to document this behavior better. They really don't have much information around how to handle query params without refreshing the page. |
Beta Was this translation helpful? Give feedback.
I ran into a similar issue. It appears in order for Inertia to remember the state of the URL you have to use their Link or router.
Here's what I ended up with to mimic
window.history.replaceState
.I'm thinking you could do the same without
replace
.I feel like they need to document this behavior better. They really don't have much information around how to handle query params without refreshing the page.