From 3ce2309ae2d92331f4b3d1794e226e89376a014f Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 13 Feb 2019 14:49:14 +0100 Subject: [PATCH] get scrolltop and scrollevent out of autohide/indicator scrollbar --- src/components/structures/AutoHideScrollbar.js | 5 +++++ src/components/structures/IndicatorScrollbar.js | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/components/structures/AutoHideScrollbar.js b/src/components/structures/AutoHideScrollbar.js index a385df0401..0f93f20407 100644 --- a/src/components/structures/AutoHideScrollbar.js +++ b/src/components/structures/AutoHideScrollbar.js @@ -114,10 +114,15 @@ export default class AutoHideScrollbar extends React.Component { } } + getScrollTop() { + return this.containerRef.scrollTop; + } + render() { return (
{ this.props.children } diff --git a/src/components/structures/IndicatorScrollbar.js b/src/components/structures/IndicatorScrollbar.js index c3e54ee900..e1516d1f64 100644 --- a/src/components/structures/IndicatorScrollbar.js +++ b/src/components/structures/IndicatorScrollbar.js @@ -59,6 +59,10 @@ export default class IndicatorScrollbar extends React.Component { } } + getScrollTop() { + return this._autoHideScrollbar.getScrollTop(); + } + componentWillUnmount() { if (this._scrollElement) { this._scrollElement.removeEventListener("scroll", this.checkOverflow);