Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2567 from matrix-org/bwindels/fixjumpdownwhitespace
Browse files Browse the repository at this point in the history
Fix: 'jump to bottom' creates big amounts of whitespace at the bottom
  • Loading branch information
dbkr authored Feb 5, 2019
2 parents 24db3e4 + 3d393b6 commit 4dd8feb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/components/structures/MessagePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
},
Expand Down
4 changes: 4 additions & 0 deletions src/components/structures/ScrollPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 4dd8feb

Please sign in to comment.