-
-
Notifications
You must be signed in to change notification settings - Fork 477
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
Add custom data to barba.history
#630
Comments
Hello @goyavo, This is the intended behavior. What's the goal of pushing random data into the window history here? 🤔 |
Thanks for answering and apologies, I somehow completely missed the reply notification. Perhaps the expression "random data" is misleading, we were thinking of specific things related to the state of the page like:
basically any kind of state data which could normally be pushed in window.history and then retrieved on load to restore the previous state of the page. Currently everything is being overwritten by barbajs. |
@goyavo OK I understand what you mean 👍 May be at least it would be better that Barba store their own data into a "subkey" inside the state object instead of erasing the whole state. We will discuss that with Thierry in our next meeting 😉 |
That would be lovely to have a way to store data in the history state. It could in the same time solve issues with the back and forward button from the browser related to issue #601 . |
barba.history
It seems to be not possible to add custom data to the
barba.history
usingpushState
as the state gets overwritten by barba.js own data. There is currently no methods provided to do that.we lost all data previously added and history.state just contains other barba.js data:
The text was updated successfully, but these errors were encountered: