Skip to content

Commit

Permalink
feat(query-builder): fix current group when add group in the middle
Browse files Browse the repository at this point in the history
  • Loading branch information
igdmdimitrov committed Nov 1, 2024
1 parent 8c643fb commit a974892
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1655,21 +1655,21 @@ export class IgxQueryBuilderTreeComponent implements AfterViewInit, OnDestroy {
}
}


private init() {
this.clearSelection();
this.cancelOperandAdd();
this.cancelOperandEdit();

// Ignore values of 'parent' and 'hovered' properties for the comparison
// Ignore values of certain properties for the comparison
const propsToIgnore = ['parent', 'hovered', 'ignoreCase', 'inEditMode', 'inAddMode'];
const propsReplacer = function replacer(key, value) {
if (key === "parent" || key === "hovered" || key === "ignoreCase" || key === "inEditMode") {
if (propsToIgnore.indexOf(key) >= 0) {
return undefined;
} else {
return value;
}
};

// Skip root being recreated if the same
const newRootGroup = this.createExpressionGroupItem(this.expressionTree);
if (JSON.stringify(this.rootGroup, propsReplacer) !== JSON.stringify(newRootGroup, propsReplacer)) {
Expand Down

0 comments on commit a974892

Please sign in to comment.