Skip to content

Commit

Permalink
fix(platform): do not select parent row if tristate is disabled (#11047)
Browse files Browse the repository at this point in the history
  • Loading branch information
N1XUS authored Dec 4, 2023
1 parent 664a780 commit c97e71d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 7 additions & 2 deletions libs/platform/src/lib/table-helpers/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ export function convertTreeObjectsToTableRows<T>(
hasChildrenKey: string,
selectedKey: string,
expandedStateKey: string,
rowNavigatable: string | boolean
rowNavigatable: string | boolean,
enableTristateMode = false
): TableRow<T>[] {
const rows: TableRow<T>[] = [];
const selectedRowsMap = getSelectionStatusByRowValue(source, selectionMode, tableRows, rowComparator);
Expand Down Expand Up @@ -185,7 +186,8 @@ export function convertTreeObjectsToTableRows<T>(
hasChildrenKey,
selectedKey,
expandedStateKey,
rowNavigatable
rowNavigatable,
enableTristateMode
);

children.forEach((c) => {
Expand Down Expand Up @@ -216,6 +218,9 @@ export function convertTreeObjectsToTableRows<T>(
applySelectionToChildren(rows, r, [], []);
return;
}
if (!enableTristateMode) {
return;
}
if (selectedAll) {
r.checked = true;
return;
Expand Down
3 changes: 2 additions & 1 deletion libs/platform/src/lib/table/table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1779,7 +1779,8 @@ export class TableComponent<T = any>
this.hasChildrenKey,
this.selectedKey,
this.expandedStateKey,
this.rowNavigatable
this.rowNavigatable,
this.enableTristateMode
);
}
return [];
Expand Down

0 comments on commit c97e71d

Please sign in to comment.