mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-15 03:15:32 +00:00
Adjust scroll when statuses above the current scroll position are deleted
This commit is contained in:
parent
0b91322762
commit
dfe1d548a5
|
@ -242,6 +242,15 @@ export default class Status extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
if (this.node && this.props.getScrollPosition) {
|
||||||
|
const position = this.props.getScrollPosition();
|
||||||
|
if (position !== null && this.node.offsetTop < position.top) {
|
||||||
|
requestAnimationFrame(() => { this.props.updateScrollBottom(position.height - position.top); });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// `setCollapsed()` sets the value of `isCollapsed` in our state, that is,
|
// `setCollapsed()` sets the value of `isCollapsed` in our state, that is,
|
||||||
// whether the toot is collapsed or not.
|
// whether the toot is collapsed or not.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue