Skip to content

Instantly share code, notes, and snippets.

@thomasdavis
Created June 22, 2017 02:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasdavis/aae5c89ddde15320e32b5678e97f44fd to your computer and use it in GitHub Desktop.
Save thomasdavis/aae5c89ddde15320e32b5678e97f44fd to your computer and use it in GitHub Desktop.
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