From 86419b19255ac1af06da6a17666d29bf267750d4 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 21 Apr 2022 17:21:44 +0100 Subject: [PATCH] Fix regression around the room list treeview keyboard a11y (#8385) --- 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 e2550bc2b6..9251cfc2ba 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() {