Fix issue with rooms not scrolling down when new events arrive
Remove an optimisation which tried to avoid recalculating the scroll on every render. The problem is that sometimes, when new events, the number of event tiles remains the same, but we still need to do a scroll, because the height of the message list changes. The optimisation was a bit of a waste of time anyway - the actual render will always be much more difficult than recalculating the scroll position.
This commit is contained in:
parent
5eff6140e0
commit
3ff19dc4db
1 changed files with 1 additions and 9 deletions
|
@ -318,11 +318,7 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
if (this.state.searchResults) return;
|
if (this.state.searchResults) return;
|
||||||
|
|
||||||
if (this.needsScrollReset) {
|
this._restoreSavedScrollState();
|
||||||
if (DEBUG_SCROLL) console.log("Resetting scroll position after tile count change");
|
|
||||||
this._restoreSavedScrollState();
|
|
||||||
this.needsScrollReset = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// have to fill space in case we're accepting an invite
|
// have to fill space in case we're accepting an invite
|
||||||
if (!this.state.paginating) this.fillSpace();
|
if (!this.state.paginating) this.fillSpace();
|
||||||
|
@ -683,10 +679,6 @@ module.exports = React.createClass({
|
||||||
}
|
}
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
if (count != this.lastEventTileCount) {
|
|
||||||
if (DEBUG_SCROLL) console.log("Queuing scroll reset (event count changed; now "+count+"; was "+this.lastEventTileCount+")");
|
|
||||||
this.needsScrollReset = true;
|
|
||||||
}
|
|
||||||
this.lastEventTileCount = count;
|
this.lastEventTileCount = count;
|
||||||
return ret;
|
return ret;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue