Hello 👋
timeSinceStart incorrectly calculated in the script as this.startScrollTs is undefined.
preventing checkScroll() from initiating stopScrolling()
Steps to reproduce the behavior:
Scroll away and press "Home" on your keyboard
Observe the loop not stopping the transform function
Fixed by changing this line:
timeSinceStart = Date.now() - this.startScrollTs;
Hello 👋
timeSinceStart
incorrectly calculated in the script asthis.startScrollTs
is undefined. preventingcheckScroll()
from initiatingstopScrolling()
Steps to reproduce the behavior:
Fixed by changing this line:
timeSinceStart = Date.now() - this.startScrollTs;
to
timeSinceStart = Date.now() - this.startScrollTs ? this.startScrollTs : Date.now();
There might be a better way to initialize this.startScrollTs?