react-tabs: Can't use Tabs in another Tabs

<Tabs selectedIndex={1}>
              <TabList>
                <Tab>Disclosure Req.</Tab>
                <Tab>Page Instructions</Tab>
              </TabList>
              <TabPanel>
                <Instructions sectionName="DisclosuresRequirements" source="disclosures/instruction" />
              </TabPanel>
              <TabPanel>
                <Tabs selectedIndex={1}>
                  <TabList>
                    <Tab>Disclosure Req.</Tab>
                    <Tab>Page Instructions</Tab>
                 </TabList>
                  <TabPanel>
                    <Instructions sectionName="DisclosuresRequirements" source="disclosures/instruction" />
                  </TabPanel>
                  <TabPanel>
                    <Instructions sectionName="EffortSummary" source="effort/instruction" />
                  </TabPanel>
                </Tabs>
              </TabPanel>
            </Tabs>

When I click on inner second Tab it change parent second tab. Who can help me with this problem?

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 16 (1 by maintainers)

Commits related to this issue

Most upvoted comments

Can one of the merge requests be accepted that solve the issue?

It happens because onlick (select tab) event is attached on whole component including tab panels. And when you put another tabs inside tab panel body - it fires twice. I bypassed this issue by attaching one more onclick listener - on parent tab panel - using stopPropagation().