Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit f394190

Browse files
authored
Merge pull request #4973 from matrix-org/t3chguy/room-list/14395
Fix show-all keyboard focus regression
2 parents f16962b + 03f9477 commit f394190

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/views/rooms/RoomSublist2.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,13 @@ export default class RoomSublist2 extends React.Component<IProps, IState> {
228228
};
229229

230230
private onShowAllClick = () => {
231+
// read number of visible tiles before we mutate it
232+
const numVisibleTiles = this.numVisibleTiles;
231233
const newHeight = this.layout.tilesToPixelsWithPadding(this.numTiles, this.padding);
232234
this.applyHeightChange(newHeight);
233235
this.setState({height: newHeight}, () => {
234-
this.focusRoomTile(this.numTiles - 1);
236+
// focus the top-most new room
237+
this.focusRoomTile(numVisibleTiles);
235238
});
236239
};
237240

0 commit comments

Comments
 (0)