mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 04:21:57 +03:00
don't set initial size based on item count anymore
This commit is contained in:
parent
8929ff9b5e
commit
8e77a6716c
1 changed files with 3 additions and 6 deletions
|
@ -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 }
|
||||||
|
|
Loading…
Reference in a new issue