Skip to content

Commit fc0461c

Browse files
committed
fix: accessibility: button tabbable, role=status
1 parent 750eecf commit fc0461c

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

src/App.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export default function App() {
6363
</div>
6464

6565
<div
66+
role="status"
6667
style={{
6768
position: "absolute",
6869
top: 0,

src/components/Button.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.btn {
2+
border: none;
23
display: inline-flex;
34
flex-direction: row;
45
flex-wrap: nowrap;

src/components/Button.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1+
import type React from "react";
12
import style from "./Button.module.css";
23

3-
interface Props {
4+
type Props = {
45
children: React.ReactNode;
5-
[key: string]: any;
6-
}
6+
} & React.ButtonHTMLAttributes<HTMLButtonElement>;
77

88
export default function Button({ children, ...props }: Props) {
99
return (
10-
<div className={style.btn} {...props}>
10+
<button className={style.btn} {...props}>
1111
{children}
12-
</div>
12+
</button>
1313
);
1414
}

src/components/EndCallButton.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ interface Props {
1616
export default function EndCallButton({ ...props }: Props) {
1717
props.style = { ...containerStyle, ...(props.style || {}) };
1818
return (
19-
<Button style={containerStyle} {...props}>
19+
<Button
20+
aria-label="End call"
21+
title="End call"
22+
style={containerStyle}
23+
{...props}
24+
>
2025
<MaterialSymbolsCallEnd />
2126
</Button>
2227
);

0 commit comments

Comments
 (0)