Open mowtwo opened 1 year ago
Hi @mowtwo I tried cloning your repo but I can't reproduce the issue. Going back to the previous page, I see the same content I saw at the beginning.
What is the issue you're experiencing?
Hi @mowtwo I tried cloning your repo but I can't reproduce the issue. Going back to the previous page, I see the same content I saw at the beginning.
What is the issue you're experiencing?
Hi @ItalyPaleAle
The problem is that when I switch pages through the browser's return button, the page components will not be destroyed correctly.
I think it may be a performance problem. I found this bug in the browser of Windows computers and the webview of Android phones with low performance. However, this problem may be caused by the use of real dom by svelte.
Can you share a screenshot/screencap of the issue? This is what it looks like on my laptop:
https://user-images.githubusercontent.com/43508/193609602-048de8eb-f49a-4a83-b0da-665cd7ace750.mov
@ItalyPaleAle
I'd like to share screenshot/screencap 😯, but I'm on national holiday,and I may need to wait five days to share screenshot/screencap on the company's computer.
This bug appears in one of my projects, it may also be related to the transition function, because after I delete some transition, this bug will not reappear.
If you want to reproduce on a MacBook with good performance, you can set the length
of the Array. from
that creates the list
in the Sub.svelte
file to a larger value, such as 200 or 300
Hi @ItalyPaleAle ,This video is the process of reproducing bugs
Thanks for sharing that. Interestingly, I can reproduce the issue too but I am not sure this is a bug in the router. I was able to confirm the router is detecting the change in the route and notifying that.
I am leaning towards this possibly being a bug in Svelte itself?
Indeed, thank you! I just had the same glitch: on route change both old and new inner contents were loaded for a very short while, equivalent to the svelte transition time I had set on the component. After removing transition I no longer see the glitch.
One can probably reproduce by adding this on a routed page.
<div transition:fade={{ duration: 1000 }}>GLITCH</div>
Thanks for sharing that. Interestingly, I can reproduce the issue too but I am not sure this is a bug in the router. I was able to confirm the router is detecting the change in the route and notifying that.
I am leaning towards this possibly being a bug in Svelte itself?
I agree with you, but I can't find the specific cause of the problem correctly at present. I hope you can help me find the problem. Thank you.
@mowtwo may be related to transitions given @da-z’s feedback. Also it wouldn’t be the first time transitions in svelte have caused bugs like these.
When I scroll on a page and then switch routes, scroll on this new page, and then use the browser's native back button to return, I will find that the page content has not been properly destroyed
This is a minimal case