Browse Source

Update scroll top state on column mounting (#4276)

closed-social-v3
unarist 7 years ago
committed by Eugen Rochko
parent
commit
4f2513337f
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      app/javascript/mastodon/components/status_list.js

+ 5
- 2
app/javascript/mastodon/components/status_list.js View File

@ -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) {

Loading…
Cancel
Save