Загрузка видео...
Не удалось загрузить видео
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 просмотров • 1 год назад •via X (Twitter)
Комментарии: 9

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.

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

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

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

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

I assume the UX feels something like this

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?

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

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

