File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,16 @@ export class Tabs extends TabNavigation<TabsBar> {
8686
8787 protected override setTabBarItems ( tabItems : com . nativescript . material . core . TabItemSpec [ ] ) {
8888 this . mTabsBar . setItems ( tabItems ) ;
89+ // The setTimeout below is necessary to ensure the scrollToTab is executed only after
90+ // all tabs are recreated. The tabs' recreation is triggered by the setItems call above.
91+ //
92+ // The setTimeout is necessary to fix an Android issue:
93+ // Android Issue: Active Tab item not displaying after nav back
94+ // Reproduce steps:
95+ // 1. On app with multiple (overflown) tab items, Switch to the last tab item
96+ // 2. Navigate to a new page
97+ // 3. Nav back to the page with Tabs
98+ // 4. Notice the active last tab item is not showing. The tab strip is showing the most left / initial tab items instead.
8999 setTimeout ( ( ) => {
90100 this . mTabsBar . scrollToTab ( this . selectedIndex ) ;
91101 } , 0 ) ;
You can’t perform that action at this time.
0 commit comments