From 4adc3afb8d8c82bedf0f5b99f314281ac79d9745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Thu, 23 May 2019 10:33:04 +0200 Subject: [PATCH] MOBILE-2937 tabs: Fix smooth top tabs scroll on iOS --- src/components/tabs/tab.ts | 2 +- src/components/tabs/tabs.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/tabs/tab.ts b/src/components/tabs/tab.ts index 6a64fb9f1..48b8a3dcb 100644 --- a/src/components/tabs/tab.ts +++ b/src/components/tabs/tab.ts @@ -122,7 +122,7 @@ export class CoreTabComponent implements OnInit, OnDestroy { // Setup tab scrolling. setTimeout(() => { - // Workarround to solve undefined this.scroll on tab change. + // Workaround to solve undefined this.scroll on tab change. const scroll: HTMLElement = this.content ? this.content.getScrollElement() : this.element.querySelector('ion-content > .scroll-content'); diff --git a/src/components/tabs/tabs.ts b/src/components/tabs/tabs.ts index 7d8944949..5d457bfd8 100644 --- a/src/components/tabs/tabs.ts +++ b/src/components/tabs/tabs.ts @@ -438,7 +438,7 @@ 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 = parseInt(scrollElement.scrollTop, 10); + this.lastScroll = scroll; } /**