From 42f44e4945ec0a3cdc5955943230969bf56aa115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Wed, 21 Aug 2019 09:48:21 +0200 Subject: [PATCH] MOBILE-3068 tabs: Fix top tabs flickr --- src/components/tabs/tabs.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/tabs/tabs.ts b/src/components/tabs/tabs.ts index 5d457bfd8..921143228 100644 --- a/src/components/tabs/tabs.ts +++ b/src/components/tabs/tabs.ts @@ -417,6 +417,13 @@ export class CoreTabsComponent implements OnInit, AfterViewInit, OnChanges, OnDe const scroll = parseInt(scrollElement.scrollTop, 10); if (scroll == this.lastScroll) { + if (scroll == 0) { + // Ensure tabbar is shown. + this.topTabsElement.style.transform = ''; + this.originalTabsContainer.style.transform = ''; + this.originalTabsContainer.style.paddingBottom = this.tabBarHeight + 'px'; + } + // Ensure scroll has been modified to avoid flicks. return; } @@ -438,7 +445,8 @@ export class CoreTabsComponent implements OnInit, AfterViewInit, OnChanges, OnDe this.originalTabsContainer.style.transform = 'translateY(-' + scroll + 'px)'; this.originalTabsContainer.style.paddingBottom = this.tabBarHeight - scroll + 'px'; } - this.lastScroll = scroll; + // Use lastScroll after moving the tabs to avoid flickering. + this.lastScroll = parseInt(scrollElement.scrollTop, 10); } /**