Bind the onWheel listener directly to props
React doesn't seem to care if this is null/undefined.
This commit is contained in:
parent
138fd4ec87
commit
17a57eb3e5
1 changed files with 1 additions and 7 deletions
|
@ -118,19 +118,13 @@ export default class AutoHideScrollbar extends React.Component {
|
||||||
return this.containerRef.scrollTop;
|
return this.containerRef.scrollTop;
|
||||||
}
|
}
|
||||||
|
|
||||||
onWheel = (e) => {
|
|
||||||
if (this.props.onWheel) {
|
|
||||||
this.props.onWheel(e);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (<div
|
return (<div
|
||||||
ref={this._collectContainerRef}
|
ref={this._collectContainerRef}
|
||||||
style={this.props.style}
|
style={this.props.style}
|
||||||
className={["mx_AutoHideScrollbar", this.props.className].join(" ")}
|
className={["mx_AutoHideScrollbar", this.props.className].join(" ")}
|
||||||
onScroll={this.props.onScroll}
|
onScroll={this.props.onScroll}
|
||||||
onWheel={this.onWheel}
|
onWheel={this.props.onWheel}
|
||||||
>
|
>
|
||||||
<div className="mx_AutoHideScrollbar_offset">
|
<div className="mx_AutoHideScrollbar_offset">
|
||||||
{ this.props.children }
|
{ this.props.children }
|
||||||
|
|
Loading…
Reference in a new issue