Skip to content

Commit 3f1e24c

Browse files
committed
fix(tabs): check if resize observer is created #5582
1 parent af2f5e1 commit 3f1e24c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

projects/igniteui-angular/src/lib/tabs/tab-item.component.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,12 @@ export class IgxTabItemComponent extends IgxTabItemBase implements AfterViewInit
278278
public setSelectedInternal(newValue: boolean) {
279279
this._isSelected = newValue;
280280
this._ngZone.runOutsideAngular(() => {
281-
if (this._isSelected) {
282-
this._resizeObserver.observe(this._element.nativeElement);
283-
} else {
284-
this._resizeObserver.disconnect();
281+
if (this._resizeObserver) {
282+
if (this._isSelected) {
283+
this._resizeObserver.observe(this._element.nativeElement);
284+
} else {
285+
this._resizeObserver.disconnect();
286+
}
285287
}
286288
});
287289
this.tabindex = newValue ? 0 : -1;

0 commit comments

Comments
 (0)