Distinguishing between human and programmatic scrolling
Sam Selikoff
0:00 / 0:00
Distinguishing between human and programmatic scrolling
8 297 просмотров · 2 г. назад
Sam Selikoff
71,5 тыс. подписчиков
8 297 просмотров · 2 г. назад
Learn how to use a lesser-known browser event along with a Resize Observer hook to build a Chat GPT–like autoscrolling component in React.
Demo from video: https://stackblitz.com/~/github.com/s...
MDN wheel event: https://developer.mozilla.org/en-US/d...
stackblitz/use-stick-to-bottom: https://github.com/stackblitz/use-sti...
👉 I'm working on a new course! Check it out here: https://buildui.com/courses/advanced-...
Timestamps:
0:00 - Intro
0:27 - Auto-scroll the parent with useOnResize
4:41 - Letting the user escape auto-scrolling
4:41 - What's wrong with the "scroll" event
5:49 - Solution: the "wheel" event
7:37 - Resuming auto-scrolling when scrolled to bottom
10:16 - Adding a button to resume auto-scrolling
13:30 - use-stick-to-bottom library