Scroll bug in SolidStart HN demo
Why:
A small nitpicky bug, but which gives a bad impression of SolidStart. I don't think it's a bug in SolidStart, more likely a bug in the HN demo, but it's hard to tell. Viewers may conclude it's a bug in SolidStart, which would give an unnecessary bad impression.
Reproduce:
- Go to https://solid-hackernews-edge.netlify.app/ or https://solid-start-hn.netlify.app/
- Click into comments of first post
- Scroll down
- Click browser back button
Effect:
The header of the post flashes briefly before you get back to the main page.
Cause:
It scrolls to the top, before going to the previous page.
Expected result:
Go directly back to main page. Then set the scoll position.
@ryansolid, @rturnq can you look at this? why would this be happening?
That shouldn't happen until after the transition but maybe it applies first. This is the scroll restoring behavior of the router.
What would cause this bug, the hackernews demo is the same one we have always had
It's probably always been there. I don't always notice details like this.
How would we fix this.. there is no userland transition code involved.. so must be one of our libraries?
~~It doesn't seem to happen on my side, using MacOS 12.5 with Google Chrome. I'm taken directly to the home page on browser back.~~
Oops, my bad, I see it now. One thing to note is if I scroll on the home page, click comments of a post, scroll down, and then browser back, the scroll postition of main page is also maintained.