Skip to content

Commit 6da9882

Browse files
committed
fix(scroll): clearInterval just to be safe
1 parent 33a6274 commit 6da9882

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/core/src/components/scroll/scroll.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ export class Scroll {
8585
}
8686
}
8787

88+
componentDidUnload() {
89+
if (this.watchDog) {
90+
clearInterval(this.watchDog);
91+
}
92+
}
93+
8894
@Listen('scroll', { passive: true })
8995
onScroll(ev: UIEvent) {
9096
const timeStamp = Date.now();
@@ -220,6 +226,9 @@ export class Scroll {
220226
isScrolling: true
221227
});
222228

229+
if (this.watchDog) {
230+
clearInterval(this.watchDog);
231+
}
223232
// watchdog
224233
this.watchDog = setInterval(() => {
225234
if (this.lastScroll < Date.now() - 120) {

0 commit comments

Comments
 (0)