diff --git a/src/components/tabs/tabs.ts b/src/components/tabs/tabs.ts index 69a046842..3afb3e95b 100644 --- a/src/components/tabs/tabs.ts +++ b/src/components/tabs/tabs.ts @@ -132,7 +132,7 @@ export class CoreTabsComponent implements OnInit, AfterViewInit, OnChanges, OnDe this.initializeTabs(); } - this.resizeFunction = this.calculateSlides.bind(this); + this.resizeFunction = this.windowResized.bind(this); window.addEventListener('resize', this.resizeFunction); } @@ -632,6 +632,15 @@ export class CoreTabsComponent implements OnInit, AfterViewInit, OnChanges, OnDe }); } + /** + * Adapt tabs to a window resize. + */ + protected windowResized(): void { + setTimeout(() => { + this.calculateSlides(); + }); + } + /** * Component destroyed. */