Merge pull request #2567 from matrix-org/bwindels/fixjumpdownwhitespace

Fix: 'jump to bottom' creates big amounts of whitespace at the bottom
pull/21833/head
David Baker 2019-02-05 10:38:24 +00:00 committed by GitHub
commit 4dd8febf1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View File

@ -642,14 +642,13 @@ module.exports = React.createClass({
updateTimelineMinHeight: function() { updateTimelineMinHeight: function() {
const scrollPanel = this.refs.scrollPanel; const scrollPanel = this.refs.scrollPanel;
const whoIsTyping = this.refs.whoIsTyping;
const isTypingVisible = whoIsTyping && whoIsTyping.isVisible();
if (scrollPanel) { if (scrollPanel) {
if (isTypingVisible) { const isAtBottom = scrollPanel.isAtBottom();
const whoIsTyping = this.refs.whoIsTyping;
const isTypingVisible = whoIsTyping && whoIsTyping.isVisible();
if (isAtBottom && isTypingVisible) {
scrollPanel.blockShrinking(); scrollPanel.blockShrinking();
} else {
scrollPanel.clearBlockShrinking();
} }
} }
}, },

View File

@ -169,6 +169,10 @@ module.exports = React.createClass({
// //
// This will also re-check the fill state, in case the paginate was inadequate // This will also re-check the fill state, in case the paginate was inadequate
this.checkScroll(); this.checkScroll();
if (!this.isAtBottom()) {
this.clearBlockShrinking();
}
}, },
componentWillUnmount: function() { componentWillUnmount: function() {