Fix some room list sticky header instabilities
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/21833/head
parent
2c1eb07768
commit
8233dec72e
|
@ -266,6 +266,7 @@ export default class LeftPanel2 extends React.Component<IProps, IState> {
|
|||
onFocus={this.onFocus}
|
||||
onBlur={this.onBlur}
|
||||
isMinimized={this.props.isMinimized}
|
||||
onResize={this.onResize}
|
||||
/>;
|
||||
|
||||
// TODO: Conference handling / calls: https://github.com/vector-im/riot-web/issues/14177
|
||||
|
|
|
@ -55,6 +55,7 @@ interface IProps {
|
|||
collapsed: boolean;
|
||||
searchFilter: string;
|
||||
isMinimized: boolean;
|
||||
onResize();
|
||||
}
|
||||
|
||||
interface IState {
|
||||
|
@ -183,7 +184,9 @@ export default class RoomList2 extends React.Component<IProps, IState> {
|
|||
layoutMap.set(tagId, new ListLayout(tagId));
|
||||
}
|
||||
|
||||
this.setState({sublists: newLists, layouts: layoutMap});
|
||||
this.setState({sublists: newLists, layouts: layoutMap}, () => {
|
||||
this.props.onResize();
|
||||
});
|
||||
};
|
||||
|
||||
private renderCommunityInvites(): React.ReactElement[] {
|
||||
|
@ -256,6 +259,7 @@ export default class RoomList2 extends React.Component<IProps, IState> {
|
|||
isInvite={aesthetics.isInvite}
|
||||
layout={this.state.layouts.get(orderedTagId)}
|
||||
isMinimized={this.props.isMinimized}
|
||||
onResize={this.props.onResize}
|
||||
extraBadTilesThatShouldntExist={extraTiles}
|
||||
/>
|
||||
);
|
||||
|
|
|
@ -66,6 +66,7 @@ interface IProps {
|
|||
layout: ListLayout;
|
||||
isMinimized: boolean;
|
||||
tagId: TagID;
|
||||
onResize();
|
||||
|
||||
// TODO: Don't use this. It's for community invites, and community invites shouldn't be here.
|
||||
// You should feel bad if you use this.
|
||||
|
@ -228,6 +229,7 @@ export default class RoomSublist2 extends React.Component<IProps, IState> {
|
|||
private toggleCollapsed = () => {
|
||||
this.props.layout.isCollapsed = !this.props.layout.isCollapsed;
|
||||
this.forceUpdate(); // because the layout doesn't trigger an update
|
||||
setImmediate(() => this.props.onResize()); // needs to happen when the DOM is updated
|
||||
};
|
||||
|
||||
private onHeaderKeyDown = (ev: React.KeyboardEvent) => {
|
||||
|
|
Loading…
Reference in New Issue