Skip to content

Commit eed3b33

Browse files
frontend: IconButton: Fix ARIA usage with label and aria-expanded
Signed-off-by: Sagar Choudhary <sagar6203620715@gmail.com>
1 parent b228929 commit eed3b33

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

frontend/src/components/common/ShowHideLabel/ShowHideLabel.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,17 @@ export default function ShowHideLabel(props: ShowHideLabelProps) {
5858

5959
return (
6060
<Box display={expanded ? 'block' : 'flex'}>
61-
<label
61+
<span
6262
id={labelIdOrRandom}
6363
style={{ wordBreak: 'break-all', whiteSpace: 'normal' }}
64-
aria-expanded={!needsButton ? undefined : expanded}
6564
>
6665
{actualText}
6766
{needsButton && (
6867
<>
6968
{!expanded && '…'}
7069
<IconButton
7170
aria-controls={labelIdOrRandom}
71+
aria-expanded={expanded}
7272
sx={{ display: 'inline' }}
7373
onClick={() => setExpanded(expandedVal => !expandedVal)}
7474
size="small"
@@ -78,7 +78,7 @@ export default function ShowHideLabel(props: ShowHideLabelProps) {
7878
</IconButton>
7979
</>
8080
)}
81-
</label>
81+
</span>
8282
</Box>
8383
);
8484
}

0 commit comments

Comments
 (0)