|
|
@ -1,5 +1,6 @@
|
|
|
|
import React from 'react';
|
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
import detectPassiveEvents from 'detect-passive-events';
|
|
|
|
import scrollTop from '../scroll';
|
|
|
|
import scrollTop from '../scroll';
|
|
|
|
|
|
|
|
|
|
|
|
export default class Column extends React.PureComponent {
|
|
|
|
export default class Column extends React.PureComponent {
|
|
|
@ -30,11 +31,19 @@ export default class Column extends React.PureComponent {
|
|
|
|
this.node = c;
|
|
|
|
this.node = c;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount () {
|
|
|
|
|
|
|
|
this.node.addEventListener('wheel', this.handleWheel, detectPassiveEvents ? { passive: true } : false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
componentWillUnmount () {
|
|
|
|
|
|
|
|
this.node.removeEventListener('wheel', this.handleWheel);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
render () {
|
|
|
|
render () {
|
|
|
|
const { children } = this.props;
|
|
|
|
const { children } = this.props;
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div role='region' className='column' ref={this.setRef} onWheel={this.handleWheel}>
|
|
|
|
<div role='region' className='column' ref={this.setRef}>
|
|
|
|
{children}
|
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
);
|
|
|
|