From 3d393b654b2d9d87839225d2fe2590eeb78df686 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 4 Feb 2019 18:27:22 +0000 Subject: [PATCH] clear min-height on ScrollPanel::componentDidUpdate to catch all cases --- src/components/structures/MessagePanel.js | 9 ++++----- src/components/structures/ScrollPanel.js | 4 ++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/structures/MessagePanel.js b/src/components/structures/MessagePanel.js index fc3b421e89..dd3d92913c 100644 --- a/src/components/structures/MessagePanel.js +++ b/src/components/structures/MessagePanel.js @@ -642,14 +642,13 @@ module.exports = React.createClass({ updateTimelineMinHeight: function() { const scrollPanel = this.refs.scrollPanel; - const whoIsTyping = this.refs.whoIsTyping; - const isTypingVisible = whoIsTyping && whoIsTyping.isVisible(); if (scrollPanel) { - if (isTypingVisible) { + const isAtBottom = scrollPanel.isAtBottom(); + const whoIsTyping = this.refs.whoIsTyping; + const isTypingVisible = whoIsTyping && whoIsTyping.isVisible(); + if (isAtBottom && isTypingVisible) { scrollPanel.blockShrinking(); - } else { - scrollPanel.clearBlockShrinking(); } } }, diff --git a/src/components/structures/ScrollPanel.js b/src/components/structures/ScrollPanel.js index be5f23c420..1df5e876e8 100644 --- a/src/components/structures/ScrollPanel.js +++ b/src/components/structures/ScrollPanel.js @@ -169,6 +169,10 @@ module.exports = React.createClass({ // // This will also re-check the fill state, in case the paginate was inadequate this.checkScroll(); + + if (!this.isAtBottom()) { + this.clearBlockShrinking(); + } }, componentWillUnmount: function() {