Skip to content

Commit b87cadd

Browse files
Change to aria level prop name
1 parent 3fcad10 commit b87cadd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/components/AccordionItemHeading.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe('AccordionItem', () => {
5959
});
6060
});
6161

62-
describe('headingLevel prop', () => {
62+
describe('ariaLevel prop', () => {
6363
it('is h3 by default', () => {
6464
const { getByTestId } = render(
6565
<Accordion>
@@ -80,7 +80,7 @@ describe('AccordionItem', () => {
8080
<AccordionItem>
8181
<AccordionItemHeading
8282
data-testid={UUIDS.FOO}
83-
headingLevel={4}
83+
ariaLevel={4}
8484
>
8585
<AccordionItemButton />
8686
</AccordionItemHeading>

src/components/AccordionItemHeading.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { HeadingAttributes } from '../helpers/types';
55

66
interface AccordianItemHeadingProps extends HeadingAttributes {
77
className?: string;
8-
headingLevel?: number;
8+
ariaLevel?: number;
99
}
1010

1111
export const SPEC_ERROR = `AccordionItemButton may contain only one child element, which must be an instance of AccordionItemButton.
@@ -19,13 +19,13 @@ From the WAI-ARIA spec (https://www.w3.org/TR/wai-aria-practices-1.1/#accordion)
1919
const Heading = React.forwardRef<HTMLHeadingElement, AccordianItemHeadingProps>(
2020
(
2121
{
22-
headingLevel = 3,
22+
ariaLevel = 3,
2323
className = 'accordion__heading',
2424
...props
2525
}: AccordianItemHeadingProps,
2626
ref,
2727
) => {
28-
const HeadingTag = `h${headingLevel}`;
28+
const HeadingTag = `h${ariaLevel}`;
2929
return React.createElement(HeadingTag, {
3030
className,
3131
...props,

0 commit comments

Comments
 (0)