Ajaxy / telegram-tt

Telegram Web A, GPL v3
https://web.telegram.org/a
GNU General Public License v3.0
2.39k stars 520 forks source link

Chats list stops scrolling after fully scrolled up until triggering new wheel event #277

Open TUTOR03 opened 1 year ago

TUTOR03 commented 1 year ago

Reproducing

1) Be sure where is no user stories 2) Use touchpad for example to make it easier to reproduce 3) Scroll up until scrollTop equals 0 and keep your fingers on the touchpad all the time 4) Try to scroll down still keeping your fingers on the touchpad 5) Scroll position stays still until you take off fingers from touchpad(trigger new wheel event)

Reason

The main problem is because of useTopOverscroll hook. It listens for scroll and wheel events even there is no user stories to display. In fact inside handleScroll function it calls stopScrollInertia that disables scroll until new wheel event. It is done to open StoryRibbon in two steps.

Solution

Disable useTopOverscroll hook, when there is no user stories. Check my PR, that fixes that problem: #276

OS: Fedora Linux 37 Browser: Google Chrome 116.0.5845.140 Telegram Web A: 10.0.1