Skip to content

A platform for community discussion. Free, open, simple.

A11Y: Add `href` to frequent poster avatars (#18627)

Keegan Georgede9ed8792a93
diff --git a/app/assets/javascripts/discourse/app/widgets/topic-map.js b/app/assets/javascripts/discourse/app/widgets/topic-map.js
index 69439af54d0..d408931dedf 100644
--- a/app/assets/javascripts/discourse/app/widgets/topic-map.js
+++ b/app/assets/javascripts/discourse/app/widgets/topic-map.js
@@ -5,6 +5,7 @@ import { createWidget } from "discourse/widgets/widget";
import { h } from "virtual-dom";
import { replaceEmoji } from "discourse/widgets/emoji";
import autoGroupFlairForUser from "discourse/lib/avatar-flair";
+import { userPath } from "discourse/lib/url";
const LINKS_SHOWN = 5;
@@ -87,12 +88,15 @@ createWidget("topic-participant", {
linkContents.push(this.attach("avatar-flair", autoFlairAttrs));
}
}
-
return h(
"a.poster.trigger-user-card",
{
className: state.toggled ? "toggled" : null,
- attributes: { title: attrs.username, "data-user-card": attrs.username },
+ attributes: {
+ title: attrs.username,
+ "data-user-card": attrs.username,
+ href: userPath(attrs.username),
+ },
},
linkContents
);