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

Fix regression around the room list treeview keyboard a11y #8385

Merged
merged 1 commit into from
Apr 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/components/views/rooms/RoomList.tsx
Original file line number Diff line number Diff line change
@@ -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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eek

return;
}
[...treeItems]
.find(e => e.offsetParent !== null)?.focus();
if (!treeItems) return;
[...treeItems].find(e => e.offsetParent !== null)?.focus();
}

public render() {