Skip to content

Commit

Permalink
change content tab selection to use id instead of name
Browse files Browse the repository at this point in the history
  • Loading branch information
chandlerprall committed Jun 18, 2018
1 parent bde9747 commit d6e2380
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/tabs/tabbed_content/tabbed_content.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class EuiTabbedContent extends Component {
// Only track selection state if it's not controlled externally.
if (!selectedTab) {
this.state = {
selectedTabName: (initialSelectedTab && initialSelectedTab.name) || tabs[0].name,
selectedTabId: (initialSelectedTab && initialSelectedTab.id) || tabs[0].id,
};
}
}
Expand All @@ -60,7 +60,7 @@ export class EuiTabbedContent extends Component {

// Only track selection state if it's not controlled externally.
if (!externalSelectedTab) {
this.setState({ selectedTabName: selectedTab.name })
this.setState({ selectedTabId: selectedTab.id })
}
};

Expand All @@ -77,7 +77,7 @@ export class EuiTabbedContent extends Component {

// Allow the consumer to control tab selection.
const selectedTab = externalSelectedTab || tabs.find(
tab => tab.name === this.state.selectedTabName
tab => tab.id === this.state.selectedTabId
);

const {
Expand Down

0 comments on commit d6e2380

Please sign in to comment.