diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index 5ae240013c..9428de3e22 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -129,12 +129,12 @@ export default class RoomSubList extends React.PureComponent { if (this.state.hidden && !this.props.forceExpand && this.props.list.some((r) => r.roomId === payload.room_id) ) { - this.onClick(); + this.toggle(); } } }; - onClick = (ev) => { + toggle = () => { if (this.isCollapsibleOnClick()) { // The header isCollapsible, so the click is to be interpreted as collapse and truncation logic const isHidden = !this.state.hidden; @@ -147,6 +147,10 @@ export default class RoomSubList extends React.PureComponent { } }; + onClick = (ev) => { + this.toggle(); + }; + onHeaderKeyDown = (ev) => { switch (ev.key) { case Key.ARROW_LEFT: