igniteui-angular 21.2.14 → 21.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -826,7 +826,8 @@ function WatchChanges() {
826
826
  const oldValue = this[key];
827
827
  if (val !== oldValue || (typeof val === 'object' && val === oldValue)) {
828
828
  originalSetter.call(this, val);
829
- if (this.ngOnChanges && !init) {
829
+ // Explicitly check whether the decorator is called during initialization
830
+ if (this.ngOnChanges && init !== undefined && !init) {
830
831
  // in case wacthed prop changes trigger ngOnChanges manually
831
832
  const changes = {
832
833
  [key]: new SimpleChange(oldValue, val, false)
@@ -15758,10 +15759,22 @@ class IgxGridStateBaseDirective {
15758
15759
  newColumns.push(ref);
15759
15760
  }
15760
15761
  });
15761
- context.currGrid.updateColumns(newColumns);
15762
- newColumns.forEach(col => {
15763
- context.currGrid.columnInit.emit(col);
15764
- });
15762
+ if (!context.currGrid._init && !context.currGrid._rendered) {
15763
+ // If grid is not rendered but is initialized (during ngAfterViewInit) wait for it to render.
15764
+ // Otherwise pushing mid detect change (mainly while calculating sizes from `calculateGridWidth` and `calculateGridSizes`) messes up headers detect changing.
15765
+ context.currGrid.rendered.pipe(first$1()).subscribe(() => {
15766
+ context.currGrid.updateColumns(newColumns);
15767
+ newColumns.forEach(col => {
15768
+ context.currGrid.columnInit.emit(col);
15769
+ });
15770
+ });
15771
+ }
15772
+ else {
15773
+ context.currGrid.updateColumns(newColumns);
15774
+ newColumns.forEach(col => {
15775
+ context.currGrid.columnInit.emit(col);
15776
+ });
15777
+ }
15765
15778
  }
15766
15779
  },
15767
15780
  groupBy: {