Skip to content

Commit

Permalink
Normalize scrolling on Microsoft Edge. (#4874)
Browse files Browse the repository at this point in the history
Improve scrolling in Edge with and without fixed height
  • Loading branch information
piotr authored Mar 7, 2018
1 parent 129243e commit 378ab1f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/tableView.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,13 +495,15 @@ function TableView(instance) {

if (!isChrome() && !isSafari()) {
this.eventManager.addEventListener(instance.rootElement, 'wheel', (event) => {
event.preventDefault();

const lineHeight = parseInt(getComputedStyle(document.body)['font-size'], 10);
const holder = that.wt.wtOverlays.scrollableElement;

let deltaY = event.wheelDeltaY || event.deltaY;
let 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 378ab1f

Please sign in to comment.