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

Commit 98edc46

Browse files
authored
Give each room directory entry the listitem role to correspond with the containing list. (#7035)
1 parent 3defb86 commit 98edc46

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

res/css/structures/_RoomDirectory.scss

+7-2
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ limitations under the License.
121121
vertical-align: text-top;
122122
margin-right: 2px;
123123
content: "";
124-
mask: url('$(res)/img/feather-customised/user.svg');
124+
mask: url("$(res)/img/feather-customised/user.svg");
125125
mask-repeat: no-repeat;
126126
mask-position: center;
127127
// scale it down and make the size slightly bigger (16 instead of 14px)
@@ -132,7 +132,8 @@ limitations under the License.
132132
}
133133
}
134134

135-
.mx_RoomDirectory_join, .mx_RoomDirectory_preview {
135+
.mx_RoomDirectory_join,
136+
.mx_RoomDirectory_preview {
136137
align-self: center;
137138
white-space: nowrap;
138139
}
@@ -220,3 +221,7 @@ limitations under the License.
220221
margin-top: 5px;
221222
}
222223
}
224+
225+
.mx_RoomDirectory_listItem {
226+
display: contents;
227+
}

src/components/structures/RoomDirectory.tsx

+11-12
Original file line numberDiff line numberDiff line change
@@ -589,9 +589,12 @@ export default class RoomDirectory extends React.Component<IProps, IState> {
589589
if (room.avatar_url) avatarUrl = mediaFromMxc(room.avatar_url).getSquareThumbnailHttp(32);
590590

591591
// We use onMouseDown instead of onClick, so that we can avoid text getting selected
592-
return [
592+
return <div
593+
key={room.room_id}
594+
role="listitem"
595+
className="mx_RoomDirectory_listItem"
596+
>
593597
<div
594-
key={`${room.room_id}_avatar`}
595598
onMouseDown={(ev) => this.onRoomClicked(room, ev)}
596599
className="mx_RoomDirectory_roomAvatar"
597600
>
@@ -603,9 +606,8 @@ export default class RoomDirectory extends React.Component<IProps, IState> {
603606
idName={name}
604607
url={avatarUrl}
605608
/>
606-
</div>,
609+
</div>
607610
<div
608-
key={`${room.room_id}_description`}
609611
onMouseDown={(ev) => this.onRoomClicked(room, ev)}
610612
className="mx_RoomDirectory_roomDescription"
611613
>
@@ -626,30 +628,27 @@ export default class RoomDirectory extends React.Component<IProps, IState> {
626628
>
627629
{ getDisplayAliasForRoom(room) }
628630
</div>
629-
</div>,
631+
</div>
630632
<div
631-
key={`${room.room_id}_memberCount`}
632633
onMouseDown={(ev) => this.onRoomClicked(room, ev)}
633634
className="mx_RoomDirectory_roomMemberCount"
634635
>
635636
{ room.num_joined_members }
636-
</div>,
637+
</div>
637638
<div
638-
key={`${room.room_id}_preview`}
639639
onMouseDown={(ev) => this.onRoomClicked(room, ev)}
640640
// cancel onMouseDown otherwise shift-clicking highlights text
641641
className="mx_RoomDirectory_preview"
642642
>
643643
{ previewButton }
644-
</div>,
644+
</div>
645645
<div
646-
key={`${room.room_id}_join`}
647646
onMouseDown={(ev) => this.onRoomClicked(room, ev)}
648647
className="mx_RoomDirectory_join"
649648
>
650649
{ joinOrViewButton }
651-
</div>,
652-
];
650+
</div>
651+
</div>;
653652
}
654653

655654
private stringLooksLikeId(s: string, fieldType: IFieldType) {

0 commit comments

Comments
 (0)