Skip to content

Commit b64f25a

Browse files
fix: prevent event propagation on table cell click to improve interaction
1 parent 6d78539 commit b64f25a

2 files changed

Lines changed: 18 additions & 11 deletions

File tree

web/oss/src/components/TestcasesTableNew/components/TestcaseSelectionCell.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const TestcaseSelectionCell = memo(function TestcaseSelectionCell({
5050
className="flex items-center justify-center w-full h-full absolute inset-0"
5151
title={tooltipTitle}
5252
style={showDirtyIndicator ? {backgroundColor: "rgb(255 251 235)"} : undefined}
53+
onClick={(e) => e.stopPropagation()}
5354
>
5455
<div className="relative">{originNode}</div>
5556
</div>

web/oss/src/components/TestcasesTableNew/components/TestcasesTableShell.tsx

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -608,21 +608,27 @@ export function TestcasesTableShell(props: TestcasesTableShellProps) {
608608
align: "center",
609609
columnVisibilityLocked: true as any,
610610
exportEnabled: false as any, // Exclude from client-side CSV export
611+
onCell: () => ({className: "ag-table-actions-cell"}),
611612
render: (_, record) => {
612613
if (record.__isSkeleton || isShowingSkeleton) return null
613614

614615
return (
615-
<TestcaseRowActionsDropdown
616-
testcaseId={record.id ? String(record.id) : String(record.key)}
617-
onEdit={() => {
618-
if (record.id) onRowClick(record)
619-
}}
620-
onDelete={() => {
621-
if (record.key) {
622-
table.deleteTestcases([String(record.key)])
623-
}
624-
}}
625-
/>
616+
<div
617+
className="w-full h-full flex items-center justify-center"
618+
onClick={(e) => e.stopPropagation()}
619+
>
620+
<TestcaseRowActionsDropdown
621+
testcaseId={record.id ? String(record.id) : String(record.key)}
622+
onEdit={() => {
623+
if (record.id) onRowClick(record)
624+
}}
625+
onDelete={() => {
626+
if (record.key) {
627+
table.deleteTestcases([String(record.key)])
628+
}
629+
}}
630+
/>
631+
</div>
626632
)
627633
},
628634
},

0 commit comments

Comments
 (0)