mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 21:24:59 +08:00
get scrolltop and scrollevent out of autohide/indicator scrollbar
This commit is contained in:
parent
de8cd88418
commit
3ce2309ae2
@ -114,10 +114,15 @@ export default class AutoHideScrollbar extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getScrollTop() {
|
||||||
|
return this.containerRef.scrollTop;
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (<div
|
return (<div
|
||||||
ref={this._collectContainerRef}
|
ref={this._collectContainerRef}
|
||||||
className={["mx_AutoHideScrollbar", this.props.className].join(" ")}
|
className={["mx_AutoHideScrollbar", this.props.className].join(" ")}
|
||||||
|
onScroll={this.props.onScroll}
|
||||||
>
|
>
|
||||||
<div className="mx_AutoHideScrollbar_offset">
|
<div className="mx_AutoHideScrollbar_offset">
|
||||||
{ this.props.children }
|
{ this.props.children }
|
||||||
|
@ -59,6 +59,10 @@ export default class IndicatorScrollbar extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getScrollTop() {
|
||||||
|
return this._autoHideScrollbar.getScrollTop();
|
||||||
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
if (this._scrollElement) {
|
if (this._scrollElement) {
|
||||||
this._scrollElement.removeEventListener("scroll", this.checkOverflow);
|
this._scrollElement.removeEventListener("scroll", this.checkOverflow);
|
||||||
|
Loading…
Reference in New Issue
Block a user