mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
revert: "fix(site): enlarge checkbox click target in workspace and task tables" (#25159)
Reverts coder/coder#24739
This commit is contained in:
@@ -221,27 +221,17 @@ const TaskRow: FC<TaskRowProps> = ({ task, checked, onCheckChange }) => {
|
||||
>
|
||||
<TableCell>
|
||||
<div className="flex items-center gap-5">
|
||||
{/* Wrap the checkbox in a click-absorbing container
|
||||
* so that near-miss clicks do not bubble up to the
|
||||
* row's navigation handler. */}
|
||||
<div
|
||||
className="flex items-center cursor-default h-[72px] pr-4 -mr-4"
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Enter" || e.key === " ") {
|
||||
e.stopPropagation();
|
||||
}
|
||||
<Checkbox
|
||||
data-testid={`checkbox-${task.id}`}
|
||||
checked={checked}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
}}
|
||||
>
|
||||
<Checkbox
|
||||
data-testid={`checkbox-${task.id}`}
|
||||
checked={checked}
|
||||
onCheckedChange={(checked) => {
|
||||
onCheckChange(task.id, Boolean(checked));
|
||||
}}
|
||||
aria-label={`Select task ${task.initial_prompt}`}
|
||||
/>
|
||||
</div>
|
||||
onCheckedChange={(checked) => {
|
||||
onCheckChange(task.id, Boolean(checked));
|
||||
}}
|
||||
aria-label={`Select task ${task.initial_prompt}`}
|
||||
/>
|
||||
<AvatarData
|
||||
title={
|
||||
<span className="block max-w-[520px] truncate">
|
||||
|
||||
@@ -185,36 +185,26 @@ export const WorkspacesTable: FC<WorkspacesTableProps> = ({
|
||||
>
|
||||
<TableCell>
|
||||
<div className="flex items-center gap-5">
|
||||
{/* Wrap the checkbox in a click-absorbing container
|
||||
* so that near-miss clicks do not bubble up to the
|
||||
* row's navigation handler. */}
|
||||
<div
|
||||
className="flex items-center cursor-default h-[72px] pr-4 -mr-4"
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Enter" || e.key === " ") {
|
||||
e.stopPropagation();
|
||||
<Checkbox
|
||||
data-testid={`checkbox-${workspace.id}`}
|
||||
disabled={cantBeChecked(workspace)}
|
||||
checked={checked}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
}}
|
||||
onCheckedChange={(checked) => {
|
||||
if (checked) {
|
||||
onCheckChange([...checkedWorkspaces, workspace]);
|
||||
} else {
|
||||
onCheckChange(
|
||||
checkedWorkspaces.filter(
|
||||
(w) => w.id !== workspace.id,
|
||||
),
|
||||
);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Checkbox
|
||||
data-testid={`checkbox-${workspace.id}`}
|
||||
disabled={cantBeChecked(workspace)}
|
||||
checked={checked}
|
||||
onCheckedChange={(checked) => {
|
||||
if (checked) {
|
||||
onCheckChange([...checkedWorkspaces, workspace]);
|
||||
} else {
|
||||
onCheckChange(
|
||||
checkedWorkspaces.filter(
|
||||
(w) => w.id !== workspace.id,
|
||||
),
|
||||
);
|
||||
}
|
||||
}}
|
||||
aria-label={`Select workspace ${workspace.name}`}
|
||||
/>
|
||||
</div>
|
||||
aria-label={`Select workspace ${workspace.name}`}
|
||||
/>
|
||||
<AvatarData
|
||||
title={
|
||||
<div className="flex items-center gap-1">
|
||||
|
||||
Reference in New Issue
Block a user