Skip to content

Commit

Permalink
Merge pull request #7022 from Sage/FE-6862
Browse files Browse the repository at this point in the history
fix(tile-select): remove not allowed aria-expanded from accordion
  • Loading branch information
nuria1110 authored Oct 18, 2024
2 parents 38f9a42 + f3d0200 commit 5820047
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const Accordion = ({

return (
<StyledContentContainer
aria-expanded={expanded}
isExpanded={expanded}
maxHeight={contentHeight}
data-role="tile-select-accordion-content-container"
Expand Down
3 changes: 3 additions & 0 deletions src/components/tile-select/tile-select.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ It is possible to render an `Accordion` footer for the `TileSelect`. Pass a desi
and a use the `accordionControl` render prop to supply the control for the expanded state of the accordion by toggling the
`accordionExpanded` prop.

To ensure proper screen reader behaviour, please pass the `aria-controls` and `aria-expanded` props to the control for the
Accordion as shown in the example.

<Canvas of={TileSelectStories.WithAccordionFooter} />

### With custom spacing
Expand Down
1 change: 1 addition & 0 deletions src/components/tile-select/tile-select.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ export const WithAccordionFooter: Story = () => {
px={1}
mt={2}
aria-controls={contentId}
aria-expanded={expanded}
id={controlId}
>
{expanded ? "Close" : "Open"} accordion
Expand Down

0 comments on commit 5820047

Please sign in to comment.