diff --git a/site/src/pages/TasksPage/TasksTable.tsx b/site/src/pages/TasksPage/TasksTable.tsx index ef7b4eee6e..29c5d1904c 100644 --- a/site/src/pages/TasksPage/TasksTable.tsx +++ b/site/src/pages/TasksPage/TasksTable.tsx @@ -221,17 +221,27 @@ const TaskRow: FC = ({ task, checked, onCheckChange }) => { >
- { - e.stopPropagation(); + {/* Wrap the checkbox in a click-absorbing container + * so that near-miss clicks do not bubble up to the + * row's navigation handler. */} +
e.stopPropagation()} + onKeyDown={(e) => { + if (e.key === "Enter" || e.key === " ") { + e.stopPropagation(); + } }} - onCheckedChange={(checked) => { - onCheckChange(task.id, Boolean(checked)); - }} - aria-label={`Select task ${task.initial_prompt}`} - /> + > + { + onCheckChange(task.id, Boolean(checked)); + }} + aria-label={`Select task ${task.initial_prompt}`} + /> +
diff --git a/site/src/pages/WorkspacesPage/WorkspacesTable.tsx b/site/src/pages/WorkspacesPage/WorkspacesTable.tsx index bcf0571d90..e7fedf3993 100644 --- a/site/src/pages/WorkspacesPage/WorkspacesTable.tsx +++ b/site/src/pages/WorkspacesPage/WorkspacesTable.tsx @@ -185,26 +185,36 @@ export const WorkspacesTable: FC = ({ >
- { - e.stopPropagation(); - }} - onCheckedChange={(checked) => { - if (checked) { - onCheckChange([...checkedWorkspaces, workspace]); - } else { - onCheckChange( - checkedWorkspaces.filter( - (w) => w.id !== workspace.id, - ), - ); + {/* Wrap the checkbox in a click-absorbing container + * so that near-miss clicks do not bubble up to the + * row's navigation handler. */} +
e.stopPropagation()} + onKeyDown={(e) => { + if (e.key === "Enter" || e.key === " ") { + e.stopPropagation(); } }} - aria-label={`Select workspace ${workspace.name}`} - /> + > + { + if (checked) { + onCheckChange([...checkedWorkspaces, workspace]); + } else { + onCheckChange( + checkedWorkspaces.filter( + (w) => w.id !== workspace.id, + ), + ); + } + }} + aria-label={`Select workspace ${workspace.name}`} + /> +