From d74c87d55419d7b493e7ee73446ed41c4f4cc262 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Wed, 2 Jun 2021 13:49:14 +0200 Subject: [PATCH] MOBILE-3320 tabs: Improve number of tabs calculation --- src/core/classes/tabs.ts | 9 +++++++-- src/core/components/tabs-outlet/core-tabs-outlet.html | 1 - 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/core/classes/tabs.ts b/src/core/classes/tabs.ts index 92f76b076..bafe71197 100644 --- a/src/core/classes/tabs.ts +++ b/src/core/classes/tabs.ts @@ -378,9 +378,14 @@ export class CoreTabsBaseComponent implements OnInit, Aft } this.maxSlides = 3; - const width = this.slidesSwiper.width; + let width = this.slidesSwiper.width; if (!width) { - return; + this.slidesSwiper.updateSize(); + width = this.slidesSwiper.width; + + if (!width) { + return; + } } const zoomLevel = await CoreSettingsHelper.getZoom(); diff --git a/src/core/components/tabs-outlet/core-tabs-outlet.html b/src/core/components/tabs-outlet/core-tabs-outlet.html index 0c5ce4ea6..74747fbe7 100644 --- a/src/core/components/tabs-outlet/core-tabs-outlet.html +++ b/src/core/components/tabs-outlet/core-tabs-outlet.html @@ -11,7 +11,6 @@