5digits / dactyl

Pentadactyl and other related Gecko extensions
Other
470 stars 98 forks source link

Smooth scroll leads to unwanted scrolling on websites with infinite scrolling #83

Open wshanks opened 9 years ago

wshanks commented 9 years ago

On some websites, smooth scroll interacts badly with infinite scrolling. I see this on tweetdeck.twitter.com. Use ;; to select any column and then j to start scrolling down. The column will grow in chunks as you scroll to the bottom of its content. The first couple times it will work okay but then the scroll position will hit the bottom and the several pages will scroll by. Tweetdeck shows only a finite section of content in the column at a time. After you have overscrolled down like this, scrolling back up to the top of the displayed section causes the scroll position to jump all the way to the very top, skipping over intermediate sections. I think what is happening is that smooth scroll is causing several scroll events to be fired in rapid succession while Tweetdeck thinks it is near the end of the scroll range (before it increases the available content to be scrolled over), so each scroll event ends up firing the creation of a new section to be added on to the infinite scroll region, with the result that several are added at once and the region that should have been shown next gets skipped over in favor of a later one.