commit: 4f2513337f77a9f05883b82e5b6a6e3a0dc10b14
parent: 015269914e0908799a4a958fe8af39cb81984986
Author: unarist <m.unarist@gmail.com>
Date: Thu, 20 Jul 2017 03:26:51 +0900
Update scroll top state on column mounting (#4276)
Diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/app/javascript/mastodon/components/status_list.js b/app/javascript/mastodon/components/status_list.js
@@ -30,8 +30,8 @@ export default class StatusList extends ImmutablePureComponent {
intersectionObserverWrapper = new IntersectionObserverWrapper();
- handleScroll = debounce((e) => {
- const { scrollTop, scrollHeight, clientHeight } = e.target;
+ handleScroll = debounce(() => {
+ const { scrollTop, scrollHeight, clientHeight } = this.node;
const offset = scrollHeight - scrollTop - clientHeight;
this._oldScrollPosition = scrollHeight - scrollTop;
@@ -49,6 +49,9 @@ export default class StatusList extends ImmutablePureComponent {
componentDidMount () {
this.attachScrollListener();
this.attachIntersectionObserver();
+
+ // Handle initial scroll posiiton
+ this.handleScroll();
}
componentDidUpdate (prevProps) {