Skip to content

Commit

Permalink
Fixed issue with reversed scrolling direction when mouse wheel is used.
Browse files Browse the repository at this point in the history
Fixed the issue (cosmocode#208) with
a reversed (up <-> down) scrolling direction when the mouse wheel is used.
This is done by backporting the change:
  handsontable/handsontable@378ab1f
in the bundled "handsontable" JavaScript library from version 0.38.0 to
version 0.34.1 which is bundled with the edittable plugin.
  • Loading branch information
frank-fegert committed Feb 29, 2024
1 parent 6ff22d3 commit 09df1b6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/handsontable.full.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 09df1b6

Please sign in to comment.