diff --git a/src/index.js b/src/index.js index bd08033..bc217aa 100644 --- a/src/index.js +++ b/src/index.js @@ -20,6 +20,8 @@ export default class ScrollHorizontal extends Component { const orig = document.firstElementChild.className document.firstElementChild.className = orig + (orig ? ' ' : '') + 'locked__' } + + DOM.findDOMNode(this.hScrollParent).addEventListener('wheel', this.onScrollStart, { passive: false }) } componentWillUnmount() { @@ -29,6 +31,8 @@ export default class ScrollHorizontal extends Component { '' ) } + + DOM.findDOMNode(this.hScrollParent).removeEventListener('wheel', this.onScrollStart) } componentDidUpdate = (prevProps) => { @@ -149,7 +153,6 @@ export default class ScrollHorizontal extends Component { return (