mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +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:
parent
6d579081c4
commit
4dad1e34b9
1 changed files with 5 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue