Loading video...

Video Failed to Load

Go Home

Easy to forget how cool this is. Each element remembers where it was scrolled to, even the virtualized element list, which is WAY dynamic and only rendered after the DOM has been measured.

109,155 views • 1 year ago •via X (Twitter)

9 Comments

Tanner Linsley's profile picture
Tanner Linsley1 year ago

For anyone concerned, the refresh delay is a hard-coded purposeful slowdown to demonstrate it's ability to restore scroll for non-sync rendered UI.

Ryan Fleury's profile picture
Ryan Fleury1 year ago

What is it doing such that it takes 4 seconds to refresh?!

Tanner Linsley's profile picture
Tanner Linsley1 year ago

It's a hard-coded purposeful slowdown to demonstrate it's ability to restore scroll for non-sync rendered UI.

Rob Pruzan's profile picture
Rob Pruzan1 year ago

how is this implemented? Is there overhead to tracking scroll position for every nested scroll view/ where is it being persisted? unless there's a browser api for this that I don't know about

Tanner Linsley's profile picture
Tanner Linsley1 year ago

It’s custom. Low overhead scroll tracking, session storage, location state keys.

Omer Gronich's profile picture
Omer Gronich1 year ago

I assume the UX feels something like this

emre's profile picture
emre1 year ago

Looks absolutely neat! I wonder if it would also make sense to apply it to infinite scrolling, loading only the items at the restored position instead of all preceding ones?

Tanner Linsley's profile picture
Tanner Linsley1 year ago

If your infinite scroller was set up to load based on a scrollTop -> cursor/page mapping, then sure!

benton's profile picture
benton1 year ago

I'm curious why it takes 4+ seconds to load the page after refreshing?

Related Videos