diff options
author | unarist <m.unarist@gmail.com> | 2017-07-20 03:26:51 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-07-19 20:26:51 +0200 |
commit | 4f2513337f77a9f05883b82e5b6a6e3a0dc10b14 (patch) | |
tree | 46d7150fc346fecfd41535ca10b9b7d16cd2bde6 /app/javascript | |
parent | 015269914e0908799a4a958fe8af39cb81984986 (diff) |
Update scroll top state on column mounting (#4276)
Diffstat (limited to 'app/javascript')
-rw-r--r-- | app/javascript/mastodon/components/status_list.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/javascript/mastodon/components/status_list.js b/app/javascript/mastodon/components/status_list.js index 86e8386bd..a8ea1ec5b 100644 --- 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) { |