Skip to content

Commit d6e0c6a

Browse files
committed
Fix accessibility of alert table dropdown
1 parent 9f58988 commit d6e0c6a

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

extensions/ql-vscode/src/view/common/TextButton.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@ const StyledButton = styled.button<{ size: Size }>`
88
color: var(--vscode-textLink-foreground);
99
border: none;
1010
cursor: pointer;
11-
font-size: ${(props) => props.size};
11+
font-size: ${(props) => props.size ?? "1em"};
12+
padding: 0;
1213
`;
1314

1415
const TextButton = ({
1516
size,
1617
onClick,
1718
children,
1819
}: {
19-
size: Size;
20-
onClick: () => void;
20+
size?: Size;
21+
onClick: (e: React.MouseEvent) => void;
2122
children: React.ReactNode;
2223
}) => (
2324
<StyledButton size={size} onClick={onClick}>
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as React from "react";
2+
import TextButton from "../common/TextButton";
23
import { chevronDown, chevronRight } from "./octicons";
34

45
type Props = {
@@ -10,12 +11,8 @@ export function AlertTableDropdownIndicatorCell({ expanded, onClick }: Props) {
1011
const indicator = expanded ? chevronDown : chevronRight;
1112

1213
return (
13-
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
14-
<td
15-
className="vscode-codeql__icon-cell vscode-codeql__dropdown-cell"
16-
onMouseDown={onClick}
17-
>
18-
{indicator}
14+
<td className="vscode-codeql__icon-cell">
15+
<TextButton onClick={onClick}>{indicator}</TextButton>
1916
</td>
2017
);
2118
}

extensions/ql-vscode/src/view/results/resultsView.css

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,15 @@
8484
.vscode-codeql__result-table th {
8585
border-top: 1px solid rgba(88, 96, 105, 0.25);
8686
border-bottom: 1px solid rgba(88, 96, 105, 0.25);
87-
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial,
88-
sans-serif, Apple Color Emoji, Segoe UI Emoji;
87+
font-family:
88+
-apple-system,
89+
BlinkMacSystemFont,
90+
Segoe UI,
91+
Helvetica,
92+
Arial,
93+
sans-serif,
94+
Apple Color Emoji,
95+
Segoe UI Emoji;
8996
background: rgba(225, 228, 232, 0.25);
9097
padding: 0.25em 0.5em;
9198
text-align: center;
@@ -167,10 +174,6 @@ td.vscode-codeql__icon-cell {
167174
width: 24px;
168175
}
169176

170-
td.vscode-codeql__dropdown-cell:hover {
171-
cursor: pointer;
172-
}
173-
174177
td.vscode-codeql__path-index-cell {
175178
text-align: right;
176179
}

0 commit comments

Comments
 (0)