Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 7dfbe7a

Browse files
committed
Fix room list roving treeview
New TooltipTarget & TextWithTooltip were not roving-accessible
1 parent c21895b commit 7dfbe7a

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

src/components/views/avatars/DecoratedRoomAvatar.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import TextWithTooltip from "../elements/TextWithTooltip";
3131
import DMRoomMap from "../../../utils/DMRoomMap";
3232
import { replaceableComponent } from "../../../utils/replaceableComponent";
3333
import { IOOBData } from "../../../stores/ThreepidInviteStore";
34+
import TooltipTarget from "../elements/TooltipTarget";
3435

3536
interface IProps {
3637
room: Room;
@@ -39,6 +40,7 @@ interface IProps {
3940
forceCount?: boolean;
4041
oobData?: IOOBData;
4142
viewAvatarOnClick?: boolean;
43+
tooltipProps?: Omit<React.ComponentProps<typeof TooltipTarget>, "label" | "tooltipClassName" | "className">;
4244
}
4345

4446
interface IState {
@@ -189,6 +191,7 @@ export default class DecoratedRoomAvatar extends React.PureComponent<IProps, ISt
189191
if (this.state.icon !== Icon.None) {
190192
icon = <TextWithTooltip
191193
tooltip={tooltipText(this.state.icon)}
194+
tooltipProps={this.props.tooltipProps}
192195
class={`mx_DecoratedRoomAvatar_icon mx_DecoratedRoomAvatar_icon_${this.state.icon.toLowerCase()}`}
193196
/>;
194197
}

src/components/views/elements/TextWithTooltip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ interface IProps {
2424
class?: string;
2525
tooltipClass?: string;
2626
tooltip: React.ReactNode;
27-
tooltipProps?: {};
27+
tooltipProps?: Omit<React.ComponentProps<typeof TooltipTarget>, "label" | "tooltipClassName" | "className">;
2828
onClick?: (ev?: React.MouseEvent) => void;
2929
}
3030

src/components/views/rooms/RoomTile.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -566,13 +566,6 @@ export default class RoomTile extends React.PureComponent<IProps, IState> {
566566
if (typeof name !== 'string') name = '';
567567
name = name.replace(":", ":\u200b"); // add a zero-width space to allow linewrapping after the colon
568568

569-
const roomAvatar = <DecoratedRoomAvatar
570-
room={this.props.room}
571-
avatarSize={32}
572-
displayBadge={this.props.isMinimized}
573-
oobData={({ avatarUrl: roomProfile.avatarMxc })}
574-
/>;
575-
576569
let badge: React.ReactNode;
577570
if (!this.props.isMinimized && this.notificationState) {
578571
// aria-hidden because we summarise the unread count/highlight status in a manual aria-label below
@@ -663,7 +656,13 @@ export default class RoomTile extends React.PureComponent<IProps, IState> {
663656
aria-selected={this.state.selected}
664657
aria-describedby={ariaDescribedBy}
665658
>
666-
{ roomAvatar }
659+
<DecoratedRoomAvatar
660+
room={this.props.room}
661+
avatarSize={32}
662+
displayBadge={this.props.isMinimized}
663+
oobData={({ avatarUrl: roomProfile.avatarMxc })}
664+
tooltipProps={{ tabIndex: isActive ? 0 : -1 }}
665+
/>
667666
{ nameContainer }
668667
{ badge }
669668
{ this.renderGeneralMenu() }

0 commit comments

Comments
 (0)