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

Commit

Permalink
Fix regression around the room list treeview keyboard a11y
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy committed Apr 21, 2022
1 parent 146bcdd commit b568732
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/components/views/rooms/RoomList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -616,11 +616,8 @@ export default class RoomList extends React.PureComponent<IProps, IState> {
public focus(): void {
// focus the first focusable element in this aria treeview widget
const treeItems = this.treeRef.current?.querySelectorAll<HTMLElement>('[role="treeitem"]');
if (treeItems) {
return;
}
[...treeItems]
.find(e => e.offsetParent !== null)?.focus();
if (!treeItems) return;
[...treeItems].find(e => e.offsetParent !== null)?.focus();
}

public render() {
Expand Down

0 comments on commit b568732

Please sign in to comment.