Slider tabs: Fix initialization.

This commit is contained in:
Konstantinos Triantafyllou 2023-07-19 14:09:10 +03:00
parent 9855f5c179
commit 584f1d22f8
1 changed files with 34 additions and 29 deletions

View File

@ -145,7 +145,13 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy {
}
ngAfterViewInit() {
this.tabs.changes.subscribe(tabs => {
this.initTabs();
this.tabs.changes.subscribe(() => {
this.initTabs();
});
}
public initTabs() {
if (typeof document !== 'undefined' && this.tabs.length > 0) {
setTimeout(() => {
if (this.position === 'horizontal') {
@ -174,7 +180,6 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy {
}
});
}
});
}
private scrollToStart() {