mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 20:24:05 -06:00
A11Y: Add heading role for post titles. (#13143)
Not all screen readers treat articles as navigable roles when moving between landmarks. To help with this, we use a `heading` role on the title, with an arbitrary depth of 2 chosen as to not conflict with the main `<h1/>`. Because ARIA roles are used, this change should be entirely non-visual. While this introduces minor navigation challenges in posts where headers are included, the vast majority of posts don't, and as screen reader users, we're used to mixed headers in longer-form content.
This commit is contained in:
parent
a363f47798
commit
549e100d8c
@ -247,6 +247,13 @@ function showReplyTab(attrs, siteSettings) {
|
||||
createWidget("post-meta-data", {
|
||||
tagName: "div.topic-meta-data",
|
||||
|
||||
buildAttributes() {
|
||||
return {
|
||||
role: "heading",
|
||||
"aria-level": "2",
|
||||
};
|
||||
},
|
||||
|
||||
settings: {
|
||||
displayPosterName: true,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user