Skip to content

Instantly share code, notes, and snippets.

@thomasdavis thomasdavis/blah.js
Created Jun 22, 2017

Embed
What would you like to do?
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
You can’t perform that action at this time.