From 40f9302ec952904ebcc5ac9017e8ec32951dc838 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 3 Sep 2021 14:24:02 +0100 Subject: [PATCH] Space panel fix aria-expanded being set to false on nodes without children --- src/components/views/spaces/SpaceTreeLevel.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/views/spaces/SpaceTreeLevel.tsx b/src/components/views/spaces/SpaceTreeLevel.tsx index 399c137e97..3561fd19bf 100644 --- a/src/components/views/spaces/SpaceTreeLevel.tsx +++ b/src/components/views/spaces/SpaceTreeLevel.tsx @@ -270,8 +270,10 @@ export class SpaceItem extends React.PureComponent { ? StaticNotificationState.forSymbol("!", NotificationColor.Red) : SpaceStore.instance.getNotificationState(space.roomId); + const hasChildren = this.state.childSpaces?.length; + let childItems; - if (this.state.childSpaces?.length && !collapsed) { + if (hasChildren && !collapsed) { childItems = { />; } - const toggleCollapseButton = this.state.childSpaces?.length ? + const toggleCollapseButton = hasChildren ? { /> : null; return ( -
  • +