A11Y: add aria-label to embedded jump link (#20117)

This commit is contained in:
Kris
2023-02-02 09:41:39 -05:00
committed by GitHub
parent 5a7b942aff
commit adbf69c300
2 changed files with 9 additions and 8 deletions

View File

@@ -8,15 +8,15 @@ createWidget("post-link-arrow", {
tagName: "div.post-link-arrow",
template: hbs`
{{#if attrs.above}}
<a href={{attrs.shareUrl}} class="post-info arrow" title={{i18n "topic.jump_reply_up"}}>
<a href={{attrs.shareUrl}} class="post-info arrow" title={{i18n "topic.jump_reply"}} aria-label={{i18n
"topic.jump_reply_aria" username=attrs.name
}}>
{{#if attrs.above}}
{{d-icon "arrow-up"}}
</a>
{{else}}
<a href={{attrs.shareUrl}} class="post-info arrow" title={{i18n "topic.jump_reply_down"}}>
{{else}}
{{d-icon "arrow-down"}}
{{/if}}
</a>
{{/if}}
`,
});
@@ -44,6 +44,7 @@ export default createWidget("embedded-post", {
h("div.topic-meta-data.embedded-reply", [
this.attach("poster-name", attrs),
this.attach("post-link-arrow", {
name: attrs.username,
above: state.above,
shareUrl: attrs.customShare,
}),