From b568732f583633cadc6749a9054dd6ac6d4c7e71 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 21 Apr 2022 13:34:47 +0100 Subject: [PATCH] Fix regression around the room list treeview keyboard a11y --- src/components/views/rooms/RoomList.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/components/views/rooms/RoomList.tsx b/src/components/views/rooms/RoomList.tsx index e2550bc2b6e..9251cfc2ba6 100644 --- a/src/components/views/rooms/RoomList.tsx +++ b/src/components/views/rooms/RoomList.tsx @@ -616,11 +616,8 @@ export default class RoomList extends React.PureComponent { public focus(): void { // focus the first focusable element in this aria treeview widget const treeItems = this.treeRef.current?.querySelectorAll('[role="treeitem"]'); - if (treeItems) { - return; - } - [...treeItems] - .find(e => e.offsetParent !== null)?.focus(); + if (!treeItems) return; + [...treeItems].find(e => e.offsetParent !== null)?.focus(); } public render() {