iterate PR

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2020-03-20 16:00:50 +00:00
parent 75c3a10bfa
commit 8a0ee2fd34

View file

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