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
Popstate events doesn't call hooks when url have query string #532
Comments
Hi @ctf0, I just checked and it works just fine. Please enable the Barba Thanks! 😉 |
here is a gif of what i have enabling debug mode displayed nothing, but here is my barba init
|
@ctf0 Hmm weird 🤔 |
Hi @ctf0, Again, after a bunch of tests, this is working fine from my side... Waiting for your reply. |
thanx for ur help so far, am using barba with laravel but anyway will creat a repo and post it today. thanx again. |
@ctf0 no problem. Please use as less dependencies as possible to properly target the problem 😉 |
here is the repo https://github.com/ctf0/barba-demo
|
@ctf0 thanks for the repo, I will give a feedback as soon as possible! 😉 |
@ctf0 OK I just finish my tests, and it sounds like a bug. As we have a meeting tomorrow with Thierry, I will expose your problem and give a feedback here. |
perfect, thanx |
i want to add that this also happens if the pages was redirected to a page with error status ex. |
Hi @ctf0, After a discussion with Thierry, as Barba is made for page transitions, this is the normal behavior since query parameters are not considered like "pages". To fix that, you just need to add a barba.init({
transitions: [{
name: 'self'
}]
});
This will tell Barba to run a transition that point to the "same" page, and you will be able to define specific I will update the documentation accordingly to prevent future similar issues. About Hope this help! |
thats good news, thanx for that. regarding the errors pages, i mean when u press the back button, the page doesnt refresh, similar to how the qs issues. i will test both cases with what u suggested and reply back. thanx again. |
tested, all done well for the qs. for the error, pressing back still doesnt refresh the page, is there any magic trick to get this one fixed as well ? |
Hi @ctf0, Can you explain in which case you have errors happening? You should also take a look at Barba utilities in order to refresh the page with Let me know 😉 |
i think i have a solution, basically am trying to prevent barba of handling the link that returns
but when i press the back btn, nothing happens which i presume it means that barba handled that link click, so how to tell barba not to ? |
Yes @ctf0, This is the actual behavior, the You should try disable the request caching in order to trigger another request call. Let me know! 😃 |
no difference unfortunately, when pressing back the url gets changed but no network call is made. i believe barba doesnt currently have a solution for that, still many thanks for you help. |
The problem
when using back / forward while the url have a query string, barba doesnt fire any events, therefor we cant get the https://barba.js.org/docs/advanced/hooks/#data-properties
data.trigger
to manually force reload the page.Steps to reproduce issue [ Good To Have ]
before, after
and log their data2 with a query string & 1 without
Environment
"@barba/core": "^2.9.7",
The text was updated successfully, but these errors were encountered: