A11Y: improve expand/collapse labeling on embedded solution post (#381)

This commit is contained in:
Kris 2025-07-10 16:21:49 -04:00 committed by GitHub
parent e4b4a97d9e
commit 0f03ec45c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -128,14 +128,17 @@ export default class SolvedAcceptedAnswer extends Component {
<div class="quote-controls"> <div class="quote-controls">
<button <button
aria-controls={{this.quoteId}} aria-controls={{this.quoteId}}
aria-expanded={{this.expanded}} aria-expanded={{if this.expanded "true" "false"}}
class="quote-toggle btn-flat" class="quote-toggle btn-flat"
type="button" type="button"
> aria-label={{if
{{icon this.expanded
(if this.expanded "chevron-up" "chevron-down") (i18n "post.collapse")
title="post.expand_collapse" (i18n "expand")
}} }}
title={{if this.expanded (i18n "post.collapse") (i18n "expand")}}
>
{{icon (if this.expanded "chevron-up" "chevron-down")}}
</button> </button>
</div> </div>
{{/if}} {{/if}}