|
@@ -8,10 +8,11 @@ export default class Column extends React.PureComponent {
|
|
|
static propTypes = {
|
|
|
children: PropTypes.node,
|
|
|
label: PropTypes.string,
|
|
|
+ bindToDocument: PropTypes.bool,
|
|
|
};
|
|
|
|
|
|
scrollTop () {
|
|
|
- const scrollable = this.node.querySelector('.scrollable');
|
|
|
+ const scrollable = this.props.bindToDocument ? document.scrollingElement : this.node.querySelector('.scrollable');
|
|
|
|
|
|
if (!scrollable) {
|
|
|
return;
|
|
@@ -33,11 +34,19 @@ export default class Column extends React.PureComponent {
|
|
|
}
|
|
|
|
|
|
componentDidMount () {
|
|
|
- this.node.addEventListener('wheel', this.handleWheel, detectPassiveEvents.hasSupport ? { passive: true } : false);
|
|
|
+ if (this.props.bindToDocument) {
|
|
|
+ document.addEventListener('wheel', this.handleWheel, detectPassiveEvents.hasSupport ? { passive: true } : false);
|
|
|
+ } else {
|
|
|
+ this.node.addEventListener('wheel', this.handleWheel, detectPassiveEvents.hasSupport ? { passive: true } : false);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
componentWillUnmount () {
|
|
|
- this.node.removeEventListener('wheel', this.handleWheel);
|
|
|
+ if (this.props.bindToDocument) {
|
|
|
+ document.removeEventListener('wheel', this.handleWheel);
|
|
|
+ } else {
|
|
|
+ this.node.removeEventListener('wheel', this.handleWheel);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
render () {
|