diff --git a/src/components/views/spaces/SpaceTreeLevel.tsx b/src/components/views/spaces/SpaceTreeLevel.tsx index c9498b8dd9..cee4cf54ec 100644 --- a/src/components/views/spaces/SpaceTreeLevel.tsx +++ b/src/components/views/spaces/SpaceTreeLevel.tsx @@ -73,7 +73,7 @@ export const SpaceButton = ({ ...props }: ButtonProps): JSX.Element => { const [menuDisplayed, handle, openMenu, closeMenu] = useContextMenu(innerRef); - const [onFocus, isActive] = useRovingTabIndex(handle); + const [onFocus, isActive, ref] = useRovingTabIndex(handle); const tabIndex = isActive ? 0 : -1; const spaceKey = _spaceKey ?? space?.roomId; @@ -144,7 +144,7 @@ export const SpaceButton = ({ title={!isNarrow || menuDisplayed ? undefined : label} onClick={onClick} onContextMenu={openMenu} - ref={handle} + ref={ref} tabIndex={tabIndex} onFocus={onFocus} >