Skip to content
Snippets Groups Projects
Commit 4f251333 authored by unarist's avatar unarist Committed by Eugen Rochko
Browse files

Update scroll top state on column mounting (#4276)

parent 01526991
No related branches found
No related tags found
No related merge requests found
...@@ -30,8 +30,8 @@ export default class StatusList extends ImmutablePureComponent { ...@@ -30,8 +30,8 @@ export default class StatusList extends ImmutablePureComponent {
intersectionObserverWrapper = new IntersectionObserverWrapper(); intersectionObserverWrapper = new IntersectionObserverWrapper();
handleScroll = debounce((e) => { handleScroll = debounce(() => {
const { scrollTop, scrollHeight, clientHeight } = e.target; const { scrollTop, scrollHeight, clientHeight } = this.node;
const offset = scrollHeight - scrollTop - clientHeight; const offset = scrollHeight - scrollTop - clientHeight;
this._oldScrollPosition = scrollHeight - scrollTop; this._oldScrollPosition = scrollHeight - scrollTop;
...@@ -49,6 +49,9 @@ export default class StatusList extends ImmutablePureComponent { ...@@ -49,6 +49,9 @@ export default class StatusList extends ImmutablePureComponent {
componentDidMount () { componentDidMount () {
this.attachScrollListener(); this.attachScrollListener();
this.attachIntersectionObserver(); this.attachIntersectionObserver();
// Handle initial scroll posiiton
this.handleScroll();
} }
componentDidUpdate (prevProps) { componentDidUpdate (prevProps) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment