mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(tabs): prevent flicker when loading tab
This commit is contained in:
@@ -166,20 +166,20 @@ export class Tabs extends Ion {
|
||||
|
||||
selectedTab.load(() => {
|
||||
this._isReady && this._isReady();
|
||||
});
|
||||
|
||||
this._tabs.forEach(tab => {
|
||||
tab.isSelected = (tab === selectedTab);
|
||||
this._tabs.forEach(tab => {
|
||||
tab.isSelected = (tab === selectedTab);
|
||||
|
||||
tab._views.forEach(viewCtrl => {
|
||||
let navbarRef = viewCtrl.navbarRef();
|
||||
if (navbarRef) {
|
||||
navbarRef.nativeElement.classList[tab.isSelected ? 'remove': 'add']('deselected-tab');
|
||||
}
|
||||
tab._views.forEach(viewCtrl => {
|
||||
let navbarRef = viewCtrl.navbarRef();
|
||||
if (navbarRef) {
|
||||
navbarRef.nativeElement.classList[tab.isSelected ? 'remove': 'add']('deselected-tab');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
this.highlight && this.highlight.select(selectedTab);
|
||||
this.highlight && this.highlight.select(selectedTab);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user