mirror of https://github.com/vector-im/riot-web
Merge pull request #4901 from matrix-org/t3chguy/room-list/112
Fix some room list sticky header instabilitiespull/21833/head
commit
3094bb32ec
|
@ -274,6 +274,7 @@ export default class LeftPanel2 extends React.Component<IProps, IState> {
|
||||||
onFocus={this.onFocus}
|
onFocus={this.onFocus}
|
||||||
onBlur={this.onBlur}
|
onBlur={this.onBlur}
|
||||||
isMinimized={this.props.isMinimized}
|
isMinimized={this.props.isMinimized}
|
||||||
|
onResize={this.onResize}
|
||||||
/>;
|
/>;
|
||||||
|
|
||||||
// TODO: Conference handling / calls: https://github.com/vector-im/riot-web/issues/14177
|
// TODO: Conference handling / calls: https://github.com/vector-im/riot-web/issues/14177
|
||||||
|
|
|
@ -51,6 +51,7 @@ interface IProps {
|
||||||
onKeyDown: (ev: React.KeyboardEvent) => void;
|
onKeyDown: (ev: React.KeyboardEvent) => void;
|
||||||
onFocus: (ev: React.FocusEvent) => void;
|
onFocus: (ev: React.FocusEvent) => void;
|
||||||
onBlur: (ev: React.FocusEvent) => void;
|
onBlur: (ev: React.FocusEvent) => void;
|
||||||
|
onResize: () => void;
|
||||||
resizeNotifier: ResizeNotifier;
|
resizeNotifier: ResizeNotifier;
|
||||||
collapsed: boolean;
|
collapsed: boolean;
|
||||||
searchFilter: string;
|
searchFilter: string;
|
||||||
|
@ -183,7 +184,9 @@ export default class RoomList2 extends React.Component<IProps, IState> {
|
||||||
layoutMap.set(tagId, new ListLayout(tagId));
|
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[] {
|
private renderCommunityInvites(): React.ReactElement[] {
|
||||||
|
@ -256,6 +259,7 @@ export default class RoomList2 extends React.Component<IProps, IState> {
|
||||||
isInvite={aesthetics.isInvite}
|
isInvite={aesthetics.isInvite}
|
||||||
layout={this.state.layouts.get(orderedTagId)}
|
layout={this.state.layouts.get(orderedTagId)}
|
||||||
isMinimized={this.props.isMinimized}
|
isMinimized={this.props.isMinimized}
|
||||||
|
onResize={this.props.onResize}
|
||||||
extraBadTilesThatShouldntExist={extraTiles}
|
extraBadTilesThatShouldntExist={extraTiles}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
|
@ -66,6 +66,7 @@ interface IProps {
|
||||||
layout: ListLayout;
|
layout: ListLayout;
|
||||||
isMinimized: boolean;
|
isMinimized: boolean;
|
||||||
tagId: TagID;
|
tagId: TagID;
|
||||||
|
onResize: () => void;
|
||||||
|
|
||||||
// TODO: Don't use this. It's for community invites, and community invites shouldn't be here.
|
// 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.
|
// You should feel bad if you use this.
|
||||||
|
@ -228,6 +229,7 @@ export default class RoomSublist2 extends React.Component<IProps, IState> {
|
||||||
private toggleCollapsed = () => {
|
private toggleCollapsed = () => {
|
||||||
this.props.layout.isCollapsed = !this.props.layout.isCollapsed;
|
this.props.layout.isCollapsed = !this.props.layout.isCollapsed;
|
||||||
this.forceUpdate(); // because the layout doesn't trigger an update
|
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) => {
|
private onHeaderKeyDown = (ev: React.KeyboardEvent) => {
|
||||||
|
|
Loading…
Reference in New Issue