Skip to content

Commit a974892

Browse files
committed
feat(query-builder): fix current group when add group in the middle
1 parent 8c643fb commit a974892

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

projects/igniteui-angular/src/lib/query-builder/query-builder-tree.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,21 +1655,21 @@ export class IgxQueryBuilderTreeComponent implements AfterViewInit, OnDestroy {
16551655
}
16561656
}
16571657

1658-
16591658
private init() {
16601659
this.clearSelection();
16611660
this.cancelOperandAdd();
16621661
this.cancelOperandEdit();
16631662

1664-
// Ignore values of 'parent' and 'hovered' properties for the comparison
1663+
// Ignore values of certain properties for the comparison
1664+
const propsToIgnore = ['parent', 'hovered', 'ignoreCase', 'inEditMode', 'inAddMode'];
16651665
const propsReplacer = function replacer(key, value) {
1666-
if (key === "parent" || key === "hovered" || key === "ignoreCase" || key === "inEditMode") {
1666+
if (propsToIgnore.indexOf(key) >= 0) {
16671667
return undefined;
16681668
} else {
16691669
return value;
16701670
}
16711671
};
1672-
1672+
16731673
// Skip root being recreated if the same
16741674
const newRootGroup = this.createExpressionGroupItem(this.expressionTree);
16751675
if (JSON.stringify(this.rootGroup, propsReplacer) !== JSON.stringify(newRootGroup, propsReplacer)) {

0 commit comments

Comments
 (0)