Skip to content

Commit

Permalink
fix(make whole accordion header clickable): fix accordion header
Browse files Browse the repository at this point in the history
  • Loading branch information
OlenaKashuba committed Mar 10, 2023
1 parent 0e198d4 commit ae14823
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ const AccordionHeader = ({ children, id, index, textSize = 'body', onClick, ...r
};

return (
<TitleContainer>
<Heading as="h3" size="h6">
<Heading as="h3" size="h6">
<TitleContainer>
<StyledButton type="button" ref={ref} onClick={handleClick} {...headerPropsRest} {...rest}>
{children}
<Cross active={isActiveSection(index)} />
</StyledButton>
</Heading>
<Cross active={isActiveSection(index)} />
</TitleContainer>
</TitleContainer>
</Heading>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,39 @@ exports[`<AccordionHeader /> renders the component with no a11y violations 1`] =
text-align: left;
}
.c1 {
-webkit-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
width: 11px;
height: 11px;
position: absolute;
right: 16px;
top: 40%;
}
.c1:after,
.c1:before {
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
background-color: #818F9B;
}
.c1:before {
width: 100%;
height: 3px;
}
.c1:after {
height: 100%;
width: 3px;
}
<button
aria-controls="one-section"
aria-disabled="false"
Expand All @@ -26,5 +59,8 @@ exports[`<AccordionHeader /> renders the component with no a11y violations 1`] =
type="button"
>
Header
<span
class="c1"
/>
</button>
`;

0 comments on commit ae14823

Please sign in to comment.