From f4af4de3ca031bff222d77c5b4af00a1c654081b Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Fri, 18 Sep 2020 09:29:30 +0200 Subject: [PATCH] MOBILE-3464 tabs: Add a setTimeout to get the right height in iOS --- src/components/tabs/tabs.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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. */