Fix regression around the room list treeview keyboard a11y (#8385)

pull/28217/head
Michael Telatynski 2022-04-21 17:21:44 +01:00 committed by GitHub
parent 73e8387799
commit 86419b1925
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -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() {