diff --git a/pkg/interface/package.json b/pkg/interface/package.json index 45e644e8b..19e5448df 100644 --- a/pkg/interface/package.json +++ b/pkg/interface/package.json @@ -40,7 +40,8 @@ "suncalc": "^1.8.0", "urbit-ob": "^5.0.0", "urbit-sigil-js": "^1.3.2", - "yup": "^0.29.3" + "yup": "^0.29.3", + "normalize-wheel": "1.0.1" }, "devDependencies": { "@babel/core": "^7.9.0", diff --git a/pkg/interface/src/views/components/VirtualScroller.tsx b/pkg/interface/src/views/components/VirtualScroller.tsx index c5b98816c..cbbd15090 100644 --- a/pkg/interface/src/views/components/VirtualScroller.tsx +++ b/pkg/interface/src/views/components/VirtualScroller.tsx @@ -1,5 +1,6 @@ import React, { PureComponent } from 'react'; import _ from 'lodash'; +import normalizeWheel from 'normalize-wheel'; interface VirtualScrollerProps { origin: 'top' | 'bottom'; @@ -220,7 +221,8 @@ export default class VirtualScroller extends PureComponent { event.preventDefault(); - element.scrollBy(0, event.deltaY * -1); + const normalized = normalizeWheel(event); + element.scrollBy(0, normalized.pixelY * -1); return false; }, { passive: false }); window.addEventListener('keydown', this.invertedKeyHandler, { passive: false }); @@ -306,4 +308,4 @@ export default class VirtualScroller extends PureComponent ); } -} \ No newline at end of file +}