zenscroll
zenscroll copied to clipboard
Issue in stopScroll timeout
I stumbled on an issue where the scroller will stop scrolling midway during a scroll. This would happen occasionally if the user was calling scrollToY repeatedly. I haven't checked other cases.
This line was the cause of the issue:
setTimeout(stopScroll, 99) // with cooldown time
The timeout in some cases did not fire until after another scroll had been started.
I was able to address by saving the timeout id and clearing if set at the start of scrollToY