solid-start icon indicating copy to clipboard operation
solid-start copied to clipboard

Scroll bug in SolidStart HN demo

Open redbar0n opened this issue 3 years ago • 6 comments

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:

  1. Go to https://solid-hackernews-edge.netlify.app/ or https://solid-start-hn.netlify.app/
  2. Click into comments of first post
  3. Scroll down
  4. 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.

redbar0n avatar Aug 07 '22 22:08 redbar0n

@ryansolid, @rturnq can you look at this? why would this be happening?

nksaraf avatar Aug 08 '22 08:08 nksaraf

That shouldn't happen until after the transition but maybe it applies first. This is the scroll restoring behavior of the router.

ryansolid avatar Aug 08 '22 19:08 ryansolid

What would cause this bug, the hackernews demo is the same one we have always had

nksaraf avatar Aug 09 '22 08:08 nksaraf

It's probably always been there. I don't always notice details like this.

ryansolid avatar Aug 09 '22 15:08 ryansolid

How would we fix this.. there is no userland transition code involved.. so must be one of our libraries?

nksaraf avatar Aug 09 '22 18:08 nksaraf

~~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.

lightyaer avatar Aug 10 '22 02:08 lightyaer