don't set initial size based on item count anymore

This commit is contained in:
Bruno Windels 2018-11-26 14:49:30 +01:00
parent 8929ff9b5e
commit 8e77a6716c

View file

@ -318,20 +318,17 @@ const RoomSubList = React.createClass({
if (len) { if (len) {
const subListClasses = classNames({ const subListClasses = classNames({
"mx_RoomSubList": true, "mx_RoomSubList": true,
"mx_RoomSubList_hidden": this.state.hidden,
"mx_RoomSubList_nonEmpty": len && !this.state.hidden, "mx_RoomSubList_nonEmpty": len && !this.state.hidden,
}); });
if (this.state.hidden) { if (this.state.hidden) {
return <div className={subListClasses} style={{flexBasis: "unset", flexGrow: "unset"}}> return <div className={subListClasses}>
{this._getHeaderJsx()} {this._getHeaderJsx()}
</div>; </div>;
} else { } else {
const heightEstimation = (len * 44) + 31 + (8 + 8);
const style = {
maxHeight: `${heightEstimation}px`,
};
const tiles = this.makeRoomTiles(); const tiles = this.makeRoomTiles();
tiles.push(...this.props.extraTiles); tiles.push(...this.props.extraTiles);
return <div style={style} className={subListClasses}> return <div className={subListClasses}>
{this._getHeaderJsx()} {this._getHeaderJsx()}
<IndicatorScrollbar className="mx_RoomSubList_scroll"> <IndicatorScrollbar className="mx_RoomSubList_scroll">
{ tiles } { tiles }