Skip to content

Commit 42b51eb

Browse files
committed
fix(select): check if subscribtion is closed, #7006
1 parent 6ed622e commit 42b51eb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

projects/igniteui-angular/src/lib/select/select.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,15 @@ export class IgxSelectComponent extends IgxDropDownComponent implements IgxSelec
367367
scrollStrategy: new AbsoluteScrollStrategy(),
368368
excludePositionTarget: true
369369
};
370-
this.children.changes.pipe(takeUntil(this.destroy$)).subscribe(() => {
370+
const changes$ = this.children.changes.pipe(takeUntil(this.destroy$)).subscribe(() => {
371371
this.setSelection(this.items.find(x => x.value === this.value));
372372
this.cdr.detectChanges();
373373
});
374-
Promise.resolve().then(() => this.children.notifyOnChanges());
374+
Promise.resolve().then(() => {
375+
if (!changes$.closed) {
376+
this.children.notifyOnChanges();
377+
}
378+
});
375379
}
376380

377381
/** @hidden @internal */

0 commit comments

Comments
 (0)