Skip to content

Commit f725d4b

Browse files
ui: Fix collapsing behaviour on tables
Previously, clicking the arrow icon to expand a region in the nodes table worked, but clicking the arrow to collapse did not. Instead, you had to click elsewhere on the row to collapse the region. This behaviour occurs since expandRowByClick is enabled on the table, and so once the row is expanded, clicking the arrow to collapse triggers the collapse and a subsequent expansion. Fixes: #146676 Release note: None
1 parent a96b522 commit f725d4b

File tree

1 file changed

+8
-2
lines changed
  • pkg/ui/workspaces/cluster-ui/src/table

1 file changed

+8
-2
lines changed

pkg/ui/workspaces/cluster-ui/src/table/table.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,18 @@ export function Table<T extends object & { children?: T[] }>(
7070
}
7171
return expanded ? (
7272
<CaretDownOutlined
73-
onClick={e => onExpand(record, e)}
73+
onClick={e => {
74+
e.stopPropagation();
75+
onExpand(record, e);
76+
}}
7477
className={cx("expand-toggle")}
7578
/>
7679
) : (
7780
<CaretRightOutlined
78-
onClick={e => onExpand(record, e)}
81+
onClick={e => {
82+
e.stopPropagation();
83+
onExpand(record, e);
84+
}}
7985
className={cx("expand-toggle")}
8086
/>
8187
);

0 commit comments

Comments
 (0)