mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-14 17:41:33 +03:00
commit
dc3036af4c
@ -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",
|
||||
|
@ -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<VirtualScrollerProps,
|
||||
if (this.props.origin === 'bottom') {
|
||||
element.addEventListener('wheel', (event) => {
|
||||
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<VirtualScrollerProps,
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user