Skip to content

Commit 7bbf300

Browse files
♿ a11y(list accordion): aria-label reads "open" / "close" (#1623)
* Create PR for #1616 * fix(list): a11y for label and title * chore: increase default errorThreshold = 0.2 --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Gery Hirschfeld <[email protected]>
1 parent cefaf1e commit 7bbf300

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

.changeset/fuzzy-seahorses-punch.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@baloise/ds-core': patch
3+
---
4+
5+
**list**: make title and aria-label editable on accordion head and move open and close labels to the icon on the right side

packages/core/src/components/bal-list/bal-list-item-accordion-head/bal-list-item-accordion-head.tsx

+5-10
Original file line numberDiff line numberDiff line change
@@ -153,16 +153,6 @@ export class ListItemAccordionHead implements ComponentInterface, Loggable {
153153
tabindex="0"
154154
aria-expanded={ariaBooleanToString(this.accordionOpen)}
155155
aria-controls={this.ariaState.controlId}
156-
title={
157-
this.accordionOpen
158-
? i18nBalListItemAccordionHead[this.language].close
159-
: i18nBalListItemAccordionHead[this.language].open
160-
}
161-
aria-label={
162-
this.accordionOpen
163-
? i18nBalListItemAccordionHead[this.language].close
164-
: i18nBalListItemAccordionHead[this.language].open
165-
}
166156
onClick={this.onClick}
167157
onKeyDown={this.onKeyDown}
168158
>
@@ -173,6 +163,11 @@ export class ListItemAccordionHead implements ComponentInterface, Loggable {
173163
name={this.icon}
174164
size="small"
175165
turn={this.accordionOpen}
166+
title={
167+
this.accordionOpen
168+
? i18nBalListItemAccordionHead[this.language].close
169+
: i18nBalListItemAccordionHead[this.language].open
170+
}
176171
></bal-icon>
177172
</bal-list-item-icon>
178173
</Host>

packages/core/src/components/bal-list/test/bal-list-v2.visual.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
<bal-list-item accordion>
110110
<bal-list-item-accordion-head>
111111
<bal-list-item-content>
112-
<bal-list-item-title>Accordion List Item 2</bal-list-item-title>
112+
<bal-list-item-title>Accordion List Item 2 Bubu</bal-list-item-title>
113113
</bal-list-item-content>
114114
</bal-list-item-accordion-head>
115115
<bal-list-item-accordion-body class="bal-list__item__accordion-body__parent">

0 commit comments

Comments
 (0)