Skip to content

Commit aa68e38

Browse files
Fix expand icon not expanding row when expandOnClick is true
1 parent 09c25d9 commit aa68e38

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/plugin/slots/ItemSlot.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
columns,
66
index,
77
isExpanded,
8+
isRow: true,
89
item,
910
level: currentLevel,
1011
toggleExpand,
@@ -153,9 +154,14 @@ const cellClasses = (column: Column): object => {
153154
};
154155
155156
function drilldownEvent(data: DrilldownEvent): void {
156-
const { item, level, toggleExpand } = data as DrilldownEvent;
157+
const { isRow, item, level, toggleExpand } = data as DrilldownEvent;
157158
158-
if (props.level >= props.levels) {
159+
if (props.level >= props.levels || props.expandOnClick && !isRow) {
160+
return;
161+
}
162+
163+
// If `expandOnClick` is true, prevent the expand button from triggering the event twice //
164+
if (props.expandOnClick && !isRow) {
159165
return;
160166
}
161167

src/types/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,7 @@ export type DrilldownEvent = {
652652
columns?: object;
653653
index?: number;
654654
isExpanded: IsExpanded;
655+
isRow?: boolean;
655656
item: DataTableItem | any;
656657
items?: object;
657658
level?: Props['level'];

0 commit comments

Comments
 (0)