MOBILE-3068 tabs: Fix top tabs flickr
parent
bcb01240a0
commit
42f44e4945
|
@ -417,6 +417,13 @@ export class CoreTabsComponent implements OnInit, AfterViewInit, OnChanges, OnDe
|
||||||
|
|
||||||
const scroll = parseInt(scrollElement.scrollTop, 10);
|
const scroll = parseInt(scrollElement.scrollTop, 10);
|
||||||
if (scroll == this.lastScroll) {
|
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.
|
// Ensure scroll has been modified to avoid flicks.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -438,7 +445,8 @@ export class CoreTabsComponent implements OnInit, AfterViewInit, OnChanges, OnDe
|
||||||
this.originalTabsContainer.style.transform = 'translateY(-' + scroll + 'px)';
|
this.originalTabsContainer.style.transform = 'translateY(-' + scroll + 'px)';
|
||||||
this.originalTabsContainer.style.paddingBottom = this.tabBarHeight - 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue