Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set First tab (0 index tab) by default? #409

Open
anarnoli opened this issue Sep 21, 2022 · 1 comment
Open

Unable to set First tab (0 index tab) by default? #409

anarnoli opened this issue Sep 21, 2022 · 1 comment

Comments

@anarnoli
Copy link

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://&#xf0f0;" class="fas"></Image>
        </MDTabStripItem>
        <MDTabStripItem>
            <Label text="Tab B"></Label>
            <Image src="font://&#xf234;" 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
Copy link
Member

@anarnoli please share the full error stack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants