-
-
Notifications
You must be signed in to change notification settings - Fork 476
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 trigger transition correctly with query string #587
Comments
Hi @BigGitWorld, Thanks for opening the issue. Regards 😉 |
Dear @xavierfoucrier |
@BigGitWorld I am busy too, so take your time 😉 |
I think I can provide an example, I stumbled the same behavior.
Navigating through the links works fine (a few 'enter' logs). When I click back and/or forward button I don't get any log, seems nothing changes except the url. |
Hi @pburdylo! Thanks for your feedback. |
Just to let you know, this is a duplicate of #532 .. 😃
But anyway, it looks a little bit buggy after a bunch of tests. barba.init({
transitions: [{
name: 'generic',
enter() {
console.log('[generic] enter');
},
}, {
name: 'self',
enter() {
console.log('[self] enter');
},
}],
}); There are disparities when only using the
|
My problem is that the transition works with query params when using links ('a href') but doesn't when using back/forward. BTW – are transition names ('generic', 'self') important or are they only informational and can be anything? I assumed the latter, but then your example shouldn't work (no difference between generic and self but for the name), which made me reconsider... |
@pburdylo |
still, the situation is confusing.
I expect same behavior when using BACK/FWD or clicking on a link when the clicked link is the same as the link in browser history stack. What do you think? PS – thanks for staying in touch, great job with the lib :) |
three more cents:
|
Hi @pburdylo, Can you take the time to build a minimal reproductible test repository? I already noticed that this is a little bit buggy. |
scenario 1 – just a plain index.html file with the code I pasted above #587 (comment) scenario 2 – the same file with barba.init replaced with the code you pasted above #587 (comment) |
do you have any update on that? |
Hi @pburdylo, Sorry but for now I haven't found the time to dive into this bug.. |
Hi, I experienced the problem while filtering the page by using query params. My current implementation of barba (2.9.7) init looks like below:
There is one scenario, where everything looks to be working fine:
Now, after clicking back button, all hooks getting fired and page contents reloads to previous state without query params as expected. Another scenario:
Now, after clicking back button, "before" hooks gets fired and barba error is displayed in console. URL in the browser change to the previous one, but content of the page do not update. @xavierfoucrier is it any chance for you to find the time to dive into this bug, please? |
@martinkosmela I will. I am currently in vacation mode with my family. Thanks for your patience, and again, sorry for the delay. |
@xavierfoucrier I hope you have had a great time vacationing with your family. Did you have any chance to take a look on this issue since then? |
@martinkosmela I am currently on a rush period right now, but, we take time with Thierry to discuss on current bugs and opened issues. This one is assign to me, and I will take the appropriate time to check it as soon as possible. Thanks again for your patience. |
I'm also seeing a similar issue where I'm getting the same I have an application that is fetching and rendering records from an API with filter controls available to the user. When a user interacts with a filter, I'm modifying the current history state with
In my case, this last step triggers the error - rather than navigating back to the previous url (including the query string), the page does not update and I see the following error in my console: I believe this is related to the use of I was able to fix my issue by manually pushing a new history item to Barba's internal history state when I update the browser's native history entry: history.replaceState({}, '', `${base}?${queryString}`);
// Adding this line fixed my issue.
barba.history.add(`${base}?${queryString}`, 'barba'); |
Any news on this ? I just ran into this issue also. It's been over 2 years since the initial bug report 🫠 As @braican stated it seems to be related to the use of This is all it takes to produce the error.
The back button works but as soon as I go forward to an url that was modified I get this error Using @barba/core 2.9.7 |
Added to the next milestone, will work on it soon 🕶️ |
Hi.
Barba version: lastest release version
Browser: firefox and Chrome (Latest versions)
How I added barba:
I have wrapped body of page () with the
data-barba="wrapper"
and main content of pages (div) with thedata-barba="container" data-barba-namespace="home"
and content for different pages are changing properly.Scenario:
When I want to move between screens in a page with pagination items, back/forward button does not change content of page.
For example:
For the first time when I click step (1)-(3), I send a request to the server to fetch data and everything works.
Also, when I click on the buttons (1),(2) in the paginated page (step 2 and 3), content of page changes.
Error:
Now I want to use back/forward button to move between steps (1), (2) and (3).
moving between (1) and (2) works, but moving between (2) and (3) does not work (only URL of page changes and content of shown paginated items does not change).
what is the problem?
When I use jquery-pjax library, everything woks fine by back/forward buttons.
I used the barba.js, because it says that it uses pjax and history API that is something I need.
I'm looking for a solution to send request to the server or use client side only to move between pages.
The text was updated successfully, but these errors were encountered: