1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

Cancel the requestAnimationFrame in the watchScroll helper (PR 18193 follow-up)

While the event listener is removed during testing, the `requestAnimationFrame` isn't cancelled and that occasionally shows up when the integration-tests are run on the bots.
This commit is contained in:
Jonas Jenwald 2024-06-26 16:31:07 +02:00
parent 6d579081c4
commit 4dad1e34b9

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;
}