Merge pull request #18335 from Snuffleupagus/watchScroll-cancelAnimationFrame
Cancel the `requestAnimationFrame` in the `watchScroll` helper (PR 18193 follow-up)
This commit is contained in:
commit
af16aa62ad
@ -193,6 +193,11 @@ function watchScroll(viewAreaElement, callback, abortSignal = undefined) {
|
|||||||
useCapture: true,
|
useCapture: true,
|
||||||
signal: abortSignal,
|
signal: abortSignal,
|
||||||
});
|
});
|
||||||
|
abortSignal?.addEventListener(
|
||||||
|
"abort",
|
||||||
|
() => window.cancelAnimationFrame(rAF),
|
||||||
|
{ once: true }
|
||||||
|
);
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user