Skip to content

Commit 8265275

Browse files
IlyesbdlalaJ12934
authored andcommitted
Refactor Accordion component to use buttons for accessibility
Signed-off-by: Ilyes Ben Dlala <ilyes.bendlala@iteratec.com>
1 parent 12c3bf6 commit 8265275

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

documentation/src/components/Accoordion.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ export default function Accordion({ items, fullWidth = false }: AccordionProps)
3939
className={styles.accordionItem}
4040
onClick={() => handleToggle(i)}
4141
>
42-
<div
42+
<button
4343
className={clsx(styles.accordionButton, {
4444
[styles.dark]: isDarkTheme,
4545
})}
4646
>
4747
{item.title}
48-
</div>
48+
</button>
4949

5050
{isExpanded && (
5151
<div className={styles.accordionPanel}>{item.content}</div>

documentation/src/css/accordion.module.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020
cursor: pointer;
2121
padding: 10px;
2222
font-weight: bold;
23+
background-color: transparent;
24+
border:none;
25+
box-shadow: none;
26+
display: block;
27+
width: 100%;
28+
text-align: left;
29+
font-size: medium;
2330
}
2431

2532
.accordionButton:hover {

0 commit comments

Comments
 (0)