MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / updateTabBar

Method updateTabBar

core/src/components/tabs/tabs.tsx:76–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

74 }
75
76 private updateTabBar() {
77 const tabBar = this.el.querySelector('ion-tab-bar');
78 if (!tabBar) {
79 return;
80 }
81
82 const tab = this.selectedTab ? this.selectedTab.tab : undefined;
83
84 // If tabs has no selected tab but tab-bar already has a selected-tab set,
85 // don't overwrite it. This handles cases where tab-bar is used without ion-tab elements.
86 if (tab === undefined) {
87 return;
88 }
89
90 if (tabBar.selectedTab === tab) {
91 return;
92 }
93
94 tabBar.selectedTab = tab;
95 }
96
97 /**
98 * Select a tab by the value of its `tab` property or an element reference. This method is only available for vanilla JavaScript projects. The Angular, React, and Vue implementations of tabs are coupled to each framework's router.

Callers 3

componentDidLoadMethod · 0.95
componentDidUpdateMethod · 0.95
setActiveMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected