Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 0f03ec4

Browse files
authored
A11Y: improve expand/collapse labeling on embedded solution post (#381)
1 parent e4b4a97 commit 0f03ec4

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

assets/javascripts/discourse/components/solved-accepted-answer.gjs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,17 @@ export default class SolvedAcceptedAnswer extends Component {
128128
<div class="quote-controls">
129129
<button
130130
aria-controls={{this.quoteId}}
131-
aria-expanded={{this.expanded}}
131+
aria-expanded={{if this.expanded "true" "false"}}
132132
class="quote-toggle btn-flat"
133133
type="button"
134-
>
135-
{{icon
136-
(if this.expanded "chevron-up" "chevron-down")
137-
title="post.expand_collapse"
134+
aria-label={{if
135+
this.expanded
136+
(i18n "post.collapse")
137+
(i18n "expand")
138138
}}
139+
title={{if this.expanded (i18n "post.collapse") (i18n "expand")}}
140+
>
141+
{{icon (if this.expanded "chevron-up" "chevron-down")}}
139142
</button>
140143
</div>
141144
{{/if}}

0 commit comments

Comments
 (0)