Created
June 22, 2017 02:15
-
-
Save thomasdavis/aae5c89ddde15320e32b5678e97f44fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onWheel (e) { | |
e.stopPropagation(); | |
const node = ReactDOM.findDOMNode(this.refs.panes); | |
if (e.nativeEvent.deltaY + node.scrollTop < 0) { | |
node.scrollTop = 0; | |
e.preventDefault(); | |
} | |
if (e.nativeEvent.deltaY + node.scrollTop > node.scrollHeight - node.clientHeight) { | |
node.scrollTop = node.scrollHeight - node.clientHeight; | |
e.preventDefault(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment