diff --git a/addon/-private/collapse-tree.js b/addon/-private/collapse-tree.js index 1f42a7c8b..fba11d785 100644 --- a/addon/-private/collapse-tree.js +++ b/addon/-private/collapse-tree.js @@ -83,31 +83,27 @@ export const TableRowMeta = EmberObject.extend({ } ), - isGroupIndeterminate: computed( - '_tree.{selection.[],selectionMatchFunction}', - '_parentMeta.isSelected', - function() { - let rowValue = get(this, '_rowValue'); - let selection = get(this, '_tree.selection'); - let selectionMatchFunction = get(this, '_tree.selectionMatchFunction'); - - if (!rowValue.children || !isArray(rowValue.children)) { - return false; - } + isGroupIndeterminate: computed('_tree.{selection.[],selectionMatchFunction}', function() { + let rowValue = get(this, '_rowValue'); + let selection = get(this, '_tree.selection'); + let selectionMatchFunction = get(this, '_tree.selectionMatchFunction'); - if (!selection || !isArray(selection)) { - return false; - } + if (!rowValue.children || !isArray(rowValue.children)) { + return false; + } - if (selectionMatchFunction) { - return rowValue.children.some(child => - selection.some(item => selectionMatchFunction(item, child)) - ); - } + if (!selection || !isArray(selection)) { + return false; + } - return rowValue.children.some(child => selection.includes(child)); + if (selectionMatchFunction) { + return rowValue.children.some(child => + selection.some(item => selectionMatchFunction(item, child)) + ); } - ), + + return rowValue.children.some(child => selection.includes(child)); + }), canCollapse: computed( '_tree.{enableTree,enableCollapse}',