1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 14:48:08 +02:00

Merge pull request #18335 from Snuffleupagus/watchScroll-cancelAnimationFrame

Cancel the `requestAnimationFrame` in the `watchScroll` helper (PR 18193 follow-up)
This commit is contained in:
Tim van der Meij 2024-06-26 16:57:02 +02:00 committed by GitHub
commit af16aa62ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -193,6 +193,11 @@ function watchScroll(viewAreaElement, callback, abortSignal = undefined) {
useCapture: true,
signal: abortSignal,
});
abortSignal?.addEventListener(
"abort",
() => window.cancelAnimationFrame(rAF),
{ once: true }
);
return state;
}