A11Y: discourse-tags should have a role and label (#19977)

This commit is contained in:
Kris 2023-01-24 13:04:32 -05:00 committed by GitHub
parent 857f35f920
commit 4da8e15801
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import renderTag from "discourse/lib/render-tag"; import renderTag from "discourse/lib/render-tag";
let callbacks = null; let callbacks = null;
@ -56,7 +57,8 @@ export default function (topic, params) {
} }
if (customHtml || (tags && tags.length > 0)) { if (customHtml || (tags && tags.length > 0)) {
buffer = "<div class='discourse-tags'>"; buffer = `<div class='discourse-tags' role='list'
aria-label=${I18n.t("tagging.tags")}>`;
if (tags) { if (tags) {
for (let i = 0; i < tags.length; i++) { for (let i = 0; i < tags.length; i++) {
buffer += buffer +=