mirror of https://github.com/vector-im/riot-web
Bind the onWheel listener directly to props
React doesn't seem to care if this is null/undefined.pull/21833/head
parent
138fd4ec87
commit
17a57eb3e5
|
@ -118,19 +118,13 @@ export default class AutoHideScrollbar extends React.Component {
|
|||
return this.containerRef.scrollTop;
|
||||
}
|
||||
|
||||
onWheel = (e) => {
|
||||
if (this.props.onWheel) {
|
||||
this.props.onWheel(e);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
return (<div
|
||||
ref={this._collectContainerRef}
|
||||
style={this.props.style}
|
||||
className={["mx_AutoHideScrollbar", this.props.className].join(" ")}
|
||||
onScroll={this.props.onScroll}
|
||||
onWheel={this.onWheel}
|
||||
onWheel={this.props.onWheel}
|
||||
>
|
||||
<div className="mx_AutoHideScrollbar_offset">
|
||||
{ this.props.children }
|
||||
|
|
Loading…
Reference in New Issue