Skip to content

Commit 2f597b3

Browse files
authored
Merge pull request #49 from springload/chore/hardcode-aria-labelledby
Chore/hardcode aria labelledby
2 parents 4ea721f + 366350a commit 2f597b3

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ Version 2.1 represents changes to devDependencies only, and should have no backw
1111

1212
* Upgrade all dev-dependencies except the eslint configs.
1313

14+
## [[v2.0.1]](https://github.com/springload/react-accessible-accordion/releases/tag/v2.0.1)
15+
16+
### Changed
17+
18+
* Minor syntax change in AccordionItemBody
19+
1420
## [[v2.0.0]](https://github.com/springload/react-accessible-accordion/releases/tag/v2.0.0)
1521

1622
Version 2.0 represents a total refactor, with a new context-based approach which should make this library more flexible, more maintainable and more comprehensively testable.

src/AccordionItemBody/accordion-item-body.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const AccordionItemBody = (props: AccordionItemBodyProps) => {
2727

2828
const { expanded } = foundItem;
2929
const id = `accordion__body-${uuid}`;
30+
const ariaLabelledby = `accordion__title-${uuid}`;
3031
const role = accordion ? 'tabpanel' : null;
3132

3233
const bodyClass = classNames(className, {
@@ -38,10 +39,7 @@ const AccordionItemBody = (props: AccordionItemBodyProps) => {
3839
id={id}
3940
className={bodyClass}
4041
aria-hidden={ariaHidden}
41-
aria-labelledby={id.replace(
42-
'accordion__body-',
43-
'accordion__title-',
44-
)}
42+
aria-labelledby={ariaLabelledby}
4543
role={role}
4644
>
4745
{children}

0 commit comments

Comments
 (0)