UX: add ARIA region role to posts (#13130)
NVDA does not detect HTML5 articles as regions. This explicitly sets a region with an aria-label denoting post numbers making it much easier to know where you are in a topic. Note role: article which is more semantically correct is not respected by NVDA d/D shortcut, hence the much more generic "region" role.
This commit is contained in:
parent
f21d50ebb6
commit
6e2ecf40c7
|
@ -596,6 +596,10 @@ createWidget("post-article", {
|
||||||
|
|
||||||
buildAttributes(attrs) {
|
buildAttributes(attrs) {
|
||||||
return {
|
return {
|
||||||
|
"aria-label": I18n.t("share.post", {
|
||||||
|
postNumber: attrs.post_number,
|
||||||
|
}),
|
||||||
|
role: "region",
|
||||||
"data-post-id": attrs.id,
|
"data-post-id": attrs.id,
|
||||||
"data-topic-id": attrs.topicId,
|
"data-topic-id": attrs.topicId,
|
||||||
"data-user-id": attrs.user_id,
|
"data-user-id": attrs.user_id,
|
||||||
|
|
Loading…
Reference in New Issue