Загрузка видео...

Не удалось загрузить видео

На главную

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

Фото профиля Tanner Linsley
Tanner Linsley1 год назад

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
Ryan Fleury1 год назад

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

Фото профиля Tanner Linsley
Tanner Linsley1 год назад

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

Фото профиля Rob Pruzan
Rob Pruzan1 год назад

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
Tanner Linsley1 год назад

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

Фото профиля Omer Gronich
Omer Gronich1 год назад

I assume the UX feels something like this

Фото профиля emre
emre1 год назад

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
Tanner Linsley1 год назад

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

Фото профиля benton
benton1 год назад

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

Похожие видео