MOBILE-3068 tabs: Fix top tabs flickr

main
Pau Ferrer Ocaña 2019-08-21 09:48:21 +02:00
parent bcb01240a0
commit 42f44e4945
1 changed files with 9 additions and 1 deletions

View File

@ -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);
}
/**