Skip to content

Commit

Permalink
fix(MdTabs): correct indicator position on transition end (#1467)
Browse files Browse the repository at this point in the history
fix #1432
  • Loading branch information
VdustR authored and marcosmoura committed Feb 2, 2018
1 parent a8e3978 commit bc3b611
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions src/components/MdTabs/MdTabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@
hasContent: false,
MdTabs: {
items: {}
},
alignmentChanging: false
}
}),
provide () {
return {
Expand Down Expand Up @@ -113,28 +112,6 @@
mdActiveTab (tab) {
this.activeTab = tab
this.$emit('md-changed', tab)
},
mdAlignment () {
if (this.alignmentChanging) {
return false
}
this.alignmentChanging = true
this.$nextTick().then(() => {
let cb = event => {
if (event.propertyName !== 'min-width') {
return false
}
this.$refs.navigation.removeEventListener('transitionend', cb)
this.setIndicatorStyles()
this.alignmentChanging = false
}
this.$refs.navigation.addEventListener('transitionend', cb)
})
}
},
methods: {
Expand Down Expand Up @@ -283,13 +260,16 @@
this.setupWatchers()
}, 100)
})
this.$refs.navigation.addEventListener('transitionend', this.setIndicatorStyles)
},
beforeDestroy () {
if (this.resizeObserver) {
this.resizeObserver.disconnect()
}
window.removeEventListener('resize', this.setIndicatorStyles)
this.$refs.navigation.removeEventListener('transitionend', this.setIndicatorStyles)
}
})
</script>
Expand Down

0 comments on commit bc3b611

Please sign in to comment.