Skip to content

Commit 64e8cfc

Browse files
committed
Accessibility: Call: fix buttons, #358
1 parent 2167d0e commit 64e8cfc

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/apps/call/components/CallButton.tsx

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22

3-
import { Box, ColorPaletteProp, IconButton, Typography, VariantProp } from '@mui/joy';
3+
import { ColorPaletteProp, FormControl, IconButton, Typography, VariantProp } from '@mui/joy';
44
import { SxProps } from '@mui/joy/styles/types';
55

66

@@ -18,7 +18,7 @@ export function CallButton(props: {
1818
sx?: SxProps,
1919
}) {
2020
return (
21-
<Box
21+
<FormControl
2222
onClick={() => !props.disabled && props.onClick?.()}
2323
sx={{
2424
display: 'flex', flexDirection: 'column', alignItems: 'center',
@@ -27,20 +27,23 @@ export function CallButton(props: {
2727
>
2828

2929
<IconButton
30-
disabled={props.disabled} variant={props.variant || 'solid'} color={props.color}
30+
aria-label={props.text}
31+
variant={props.variant || 'solid'} color={props.color}
32+
disabled={props.disabled}
3133
sx={{
3234
'--IconButton-size': { xs: '4.2rem', md: '5rem' },
3335
borderRadius: '50%',
3436
// boxShadow: 'lg',
3537
...props.sx,
36-
}}>
38+
}}
39+
>
3740
<props.Icon />
3841
</IconButton>
3942

40-
<Typography level='title-md' variant={props.disabled ? 'soft' : undefined}>
43+
<Typography aria-hidden level='title-md' variant={props.disabled ? 'soft' : undefined}>
4144
{props.text}
4245
</Typography>
4346

44-
</Box>
47+
</FormControl>
4548
);
4649
}

0 commit comments

Comments
 (0)