-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 failing test for x-for
after back with wire:navigate
#7034
Add failing test for x-for
after back with wire:navigate
#7034
Conversation
I was able to trace this down a little. It looks like when When using If I do manually remove the rendered div elements from the session storage before hitting the back button everything seems to work fine. So I think there are two options how to proceed:
As I don't know if I am on the right track I would like to hear your opinions before proceeding. @calebporzio Update: Looks like there is a workaround for this: #6849 (reply in thread) |
Following along, just ran into this issue |
Did you guys found any workaround? |
@robsontenorio I add a class like 'to-remove-before-navigating' to every child in x-for (or any other element that cause this kind of problems), and add the following script:
I'm pretty sure I've found this code on some other issue/discussion but I'm not sure where. |
@mybouhssina I am using that hack... pretty annoying :( |
@robsontenorio yeah it's pretty annoying, but much better than the errors whenever I press the back button ^^' |
Good points. I think the answer here is doing this in the cleanup() of x-for. I would welcome a PR for that on Alpine! |
Okay. I can give it a try. |
Hey @gehrisandro Have you sent another PR to handle this ? |
isn't it navigate plugin ( |
nvm this happened in alpine + htmx too (alpinejs/alpine#2924) |
No, not yet. I am busy with other stuff but maybe I will come back to this one later. |
fixed alpinejs/alpine#4015 |
This PR adds a failing test for
x-for
after the back button is used withwire:navigate
.Given the following code:
After navigating to the second page and returning back by using the browsers "back" button. There are six
.item
divs in the DOM and there are three warnings and three errors in the console.