Unable to set First tab (0 index tab) by default?
anarnoli opened this issue · 1 comments
anarnoli commented
I am using MDTabs component and unable to set first tab by default when page loads
There is a property called selectedIndex
in which if I set 0
then it throws ERROR TypeError: Cannot read property 'addObserverForKeyPathOptionsContext' of undefined
So I have to set 1
always which selects 2nd tab be default. Please suggest how to achieve it.
Does it make any impact if using <MDTabs>
inside <BottomNavigationBar>
?
<MDTabs selectedIndex="1" tabsPosition="top" swipeEnabled="false">
<MDTabStrip>
<MDTabStripItem>
<Label text="Tab A"></Label>
<Image src="font://" class="fas"></Image>
</MDTabStripItem>
<MDTabStripItem>
<Label text="Tab B"></Label>
<Image src="font://" class="fas"></Image>
</MDTabStripItem>
</MDTabStrip>
<MDTabContentItem>
<Label text="Tab A Details" class="h2 text-center"></Label>
</MDTabContentItem>
<MDTabContentItem>
<GridLayout>
<Label text="Tab B Details" class="h2 text-center"></Label>
</GridLayout>
</MDTabContentItem>
</MDTabs>
farfromrefug commented
@anarnoli please share the full error stack