Add passive: false when removing wheel listeners

Code of listening `wheel` event uses `{passive: false}`,
while this argument will be treated as `true` before Firefox 49,
accordin to https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Browser_compatibility .

This commit adds it when removing wheel listeners,
so that such listeners can be really removed.
This commit is contained in:
gdh1995 2020-03-25 21:53:08 +08:00
parent 475fa1f97f
commit a527eb8c92
2 changed files with 4 additions and 2 deletions

View File

@ -1719,7 +1719,7 @@ const PDFViewerApplication = {
const { _boundEvents } = this;
window.removeEventListener("visibilitychange", webViewerVisibilityChange);
window.removeEventListener("wheel", webViewerWheel);
window.removeEventListener("wheel", webViewerWheel, { passive: false });
window.removeEventListener("click", webViewerClick);
window.removeEventListener("keydown", webViewerKeyDown);
window.removeEventListener("resize", _boundEvents.windowResize);

View File

@ -437,7 +437,9 @@ class PDFPresentationMode {
_removeWindowListeners() {
window.removeEventListener("mousemove", this.showControlsBind);
window.removeEventListener("mousedown", this.mouseDownBind);
window.removeEventListener("wheel", this.mouseWheelBind);
window.removeEventListener("wheel", this.mouseWheelBind, {
passive: false,
});
window.removeEventListener("keydown", this.resetMouseScrollStateBind);
window.removeEventListener("contextmenu", this.contextMenuBind);
window.removeEventListener("touchstart", this.touchSwipeBind);