Hi, ive made infinite scroll using remix, but I have one small problem. When user scrolls fast to bottom and he gets stick to it, the fetcher will fetch it in infinite. Check out the video https://cdn.ismcserver.online/chrome_O1HjhQxGAB.mp4
any ideas how can I unstick the client from bottom?
#prevent scroll sticks to bottom in infinite scroll
1 messages · Page 1 of 1 (latest)
Debounce your fetch? Are you using fetcher.submit/load to get new data?
yes, im using fetcher.load to get data. how do i debounce?
do I just setTimeout it?
?
@inland glacier Hey sorrry, you can use lodash _.debounce or you can use chatGPT to write you a more specific debounce function if you've never written one. There's also a ton of docs online on how to debounce in react
setTimeout won't wait for the function to execute, it will just stream everything X seconds from now, unless you cancel the timeout for a new one
should it look something like that @graceful hemlock https://cdn.ismcserver.online/chrome_qUGSRo2lL6.mp4 ? I'd like to prevent scroll from following new items and just stay at old top position
?