From 09df1b633ea65011523e0773abb0192c50cc3a47 Mon Sep 17 00:00:00 2001 From: Frank Fegert Date: Thu, 29 Feb 2024 22:37:11 +0100 Subject: [PATCH] Fixed issue with reversed scrolling direction when mouse wheel is used. Fixed the issue (https://github.com/cosmocode/edittable/issues/208) with a reversed (up <-> down) scrolling direction when the mouse wheel is used. This is done by backporting the change: https://github.com/handsontable/handsontable/commit/378ab1f9c56d421ae8d541948fa6db99a9880bcb in the bundled "handsontable" JavaScript library from version 0.38.0 to version 0.34.1 which is bundled with the edittable plugin. --- lib/handsontable.full.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/handsontable.full.js b/lib/handsontable.full.js index 1ae5b21..9c1e5c5 100644 --- a/lib/handsontable.full.js +++ b/lib/handsontable.full.js @@ -48545,13 +48545,15 @@ function TableView(instance) { if (!(0, _browser.isChrome)() && !(0, _browser.isSafari)()) { this.eventManager.addEventListener(instance.rootElement, 'wheel', function (event) { - event.preventDefault(); - var lineHeight = parseInt((0, _element.getComputedStyle)(document.body)['font-size'], 10); var holder = that.wt.wtOverlays.scrollableElement; - var deltaY = event.wheelDeltaY || event.deltaY; - var deltaX = event.wheelDeltaX || event.deltaX; + if (holder !== window) { + event.preventDefault(); + } + + let deltaY = (-1) * event.wheelDeltaY || event.deltaY; + let deltaX = (-1) * event.wheelDeltaX || event.deltaX; switch (event.deltaMode) { case 0: