MOBILE-3464 tabs: Add a setTimeout to get the right height in iOS

main
Dani Palou 2020-09-18 09:29:30 +02:00
parent fd9b79a39f
commit f4af4de3ca
1 changed files with 10 additions and 1 deletions

View File

@ -132,7 +132,7 @@ export class CoreTabsComponent implements OnInit, AfterViewInit, OnChanges, OnDe
this.initializeTabs(); this.initializeTabs();
} }
this.resizeFunction = this.calculateSlides.bind(this); this.resizeFunction = this.windowResized.bind(this);
window.addEventListener('resize', this.resizeFunction); 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. * Component destroyed.
*/ */