Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

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 Aufrufe • vor 1 Jahr •via X (Twitter)

9 Kommentare

Profilbild von Tanner Linsley
Tanner Linsleyvor 1 Jahr

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.

Profilbild von Ryan Fleury
Ryan Fleuryvor 1 Jahr

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

Profilbild von Tanner Linsley
Tanner Linsleyvor 1 Jahr

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

Profilbild von Rob Pruzan
Rob Pruzanvor 1 Jahr

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

Profilbild von Tanner Linsley
Tanner Linsleyvor 1 Jahr

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

Profilbild von Omer Gronich
Omer Gronichvor 1 Jahr

I assume the UX feels something like this

Profilbild von emre
emrevor 1 Jahr

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?

Profilbild von Tanner Linsley
Tanner Linsleyvor 1 Jahr

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

Profilbild von benton
bentonvor 1 Jahr

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

Ähnliche Videos