From a984a807fdc4ec94d47c4d113eefa76eb435d8b6 Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Fri, 23 Jun 2023 09:25:03 -0400 Subject: [PATCH] A11Y: Don't output `aria-labelledby` when card is empty (#22247) The user card is always present in the DOM. Therefore we only need to add the `aria-labelledby` attribute when there is a user (and a title) to point to. --- .../javascripts/discourse/app/components/card-container.hbs | 1 - .../discourse/app/components/user-card-contents.js | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/app/components/card-container.hbs b/app/assets/javascripts/discourse/app/components/card-container.hbs index b2a70887f13..9bde984d351 100644 --- a/app/assets/javascripts/discourse/app/components/card-container.hbs +++ b/app/assets/javascripts/discourse/app/components/card-container.hbs @@ -9,7 +9,6 @@ @composePrivateMessage={{route-action "composePrivateMessage"}} @createNewMessageViaParams={{route-action "createNewMessageViaParams"}} role="dialog" - aria-labelledby="discourse-user-card-title" />