From 3631d6d61dd7891b568ae291e81e870a621d839e Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 9 Sep 2020 14:35:04 -0500 Subject: [PATCH] Don't hijack scrollbar when status is unmounted, fixes #404 --- app/soapbox/components/status.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/soapbox/components/status.js b/app/soapbox/components/status.js index f8d46b043..8acb4e7f5 100644 --- a/app/soapbox/components/status.js +++ b/app/soapbox/components/status.js @@ -151,14 +151,16 @@ 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); - }); - } - } + // FIXME: Run this code only when a status is being deleted. + // + // 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); + // }); + // } + // } } handleToggleMediaVisibility = () => {