mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 01:52:42 +03:00
commit
dc3036af4c
@ -40,7 +40,8 @@
|
|||||||
"suncalc": "^1.8.0",
|
"suncalc": "^1.8.0",
|
||||||
"urbit-ob": "^5.0.0",
|
"urbit-ob": "^5.0.0",
|
||||||
"urbit-sigil-js": "^1.3.2",
|
"urbit-sigil-js": "^1.3.2",
|
||||||
"yup": "^0.29.3"
|
"yup": "^0.29.3",
|
||||||
|
"normalize-wheel": "1.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.9.0",
|
"@babel/core": "^7.9.0",
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import React, { PureComponent } from 'react';
|
import React, { PureComponent } from 'react';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
import normalizeWheel from 'normalize-wheel';
|
||||||
|
|
||||||
interface VirtualScrollerProps {
|
interface VirtualScrollerProps {
|
||||||
origin: 'top' | 'bottom';
|
origin: 'top' | 'bottom';
|
||||||
@ -220,7 +221,8 @@ export default class VirtualScroller extends PureComponent<VirtualScrollerProps,
|
|||||||
if (this.props.origin === 'bottom') {
|
if (this.props.origin === 'bottom') {
|
||||||
element.addEventListener('wheel', (event) => {
|
element.addEventListener('wheel', (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
element.scrollBy(0, event.deltaY * -1);
|
const normalized = normalizeWheel(event);
|
||||||
|
element.scrollBy(0, normalized.pixelY * -1);
|
||||||
return false;
|
return false;
|
||||||
}, { passive: false });
|
}, { passive: false });
|
||||||
window.addEventListener('keydown', this.invertedKeyHandler, { passive: false });
|
window.addEventListener('keydown', this.invertedKeyHandler, { passive: false });
|
||||||
|
Loading…
Reference in New Issue
Block a user