Skip to content

Commit

Permalink
update activeFocusedTab on click
Browse files Browse the repository at this point in the history
  • Loading branch information
ofrankowska committed Jun 4, 2021
1 parent 19b1995 commit fd12282
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/molecules/tabs/Tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,14 @@ export default {
methods: {
selectTab (selectedTab) {
this.$emit('click', selectedTab.name)
this.tabs.forEach(tab => {
this.tabs.forEach((tab, index) => {
if (selectedTab === this.activeFocusedTab) {
tab.isActive = tab.name === this.tabs[this.activeFocusedTab].name
} else if (tab.name === selectedTab.name) {
tab.isActive = true
this.activeFocusedTab = index
} else {
tab.isActive = tab.name === selectedTab.name
tab.isActive = false
}
})
},
Expand Down

0 comments on commit fd12282

Please sign in to comment.