From de9ed8792a93cd7c602d57b0d6df2bb816b15dd1 Mon Sep 17 00:00:00 2001 From: Keegan George Date: Mon, 17 Oct 2022 14:08:59 -0700 Subject: [PATCH] A11Y: Add `href` to frequent poster avatars (#18627) --- app/assets/javascripts/discourse/app/widgets/topic-map.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 );