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

Commit 2c2d955

Browse files
committed
Linkify topics in space room directory results
1 parent 7bd1a2b commit 2c2d955

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/components/structures/SpaceRoomDirectory.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import TextWithTooltip from "../views/elements/TextWithTooltip";
4141
import {useStateToggle} from "../../hooks/useStateToggle";
4242
import {getOrder} from "../../stores/SpaceStore";
4343
import AccessibleTooltipButton from "../views/elements/AccessibleTooltipButton";
44+
import {linkifyElement} from "../../HtmlUtils";
4445

4546
interface IHierarchyProps {
4647
space: Room;
@@ -172,7 +173,16 @@ const Tile: React.FC<ITileProps> = ({
172173
{ suggestedSection }
173174
</div>
174175

175-
<div className="mx_SpaceRoomDirectory_roomTile_info">
176+
<div
177+
className="mx_SpaceRoomDirectory_roomTile_info"
178+
ref={e => e && linkifyElement(e)}
179+
onClick={ev => {
180+
// prevent clicks on links from bubbling up to the room tile
181+
if ((ev.target as HTMLElement).tagName === "A") {
182+
ev.stopPropagation();
183+
}
184+
}}
185+
>
176186
{ description }
177187
</div>
178188
<div className="mx_SpaceRoomDirectory_actions">

0 commit comments

Comments
 (0)