Skip to content

Commit bc3b611

Browse files
VdustRmarcosmoura
authored andcommitted
fix(MdTabs): correct indicator position on transition end (#1467)
fix #1432
1 parent a8e3978 commit bc3b611

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

src/components/MdTabs/MdTabs.vue

+4-24
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@
7676
hasContent: false,
7777
MdTabs: {
7878
items: {}
79-
},
80-
alignmentChanging: false
79+
}
8180
}),
8281
provide () {
8382
return {
@@ -113,28 +112,6 @@
113112
mdActiveTab (tab) {
114113
this.activeTab = tab
115114
this.$emit('md-changed', tab)
116-
},
117-
mdAlignment () {
118-
if (this.alignmentChanging) {
119-
return false
120-
}
121-
122-
this.alignmentChanging = true
123-
124-
this.$nextTick().then(() => {
125-
let cb = event => {
126-
if (event.propertyName !== 'min-width') {
127-
return false
128-
}
129-
130-
this.$refs.navigation.removeEventListener('transitionend', cb)
131-
this.setIndicatorStyles()
132-
this.alignmentChanging = false
133-
}
134-
135-
this.$refs.navigation.addEventListener('transitionend', cb)
136-
})
137-
138115
}
139116
},
140117
methods: {
@@ -283,13 +260,16 @@
283260
this.setupWatchers()
284261
}, 100)
285262
})
263+
264+
this.$refs.navigation.addEventListener('transitionend', this.setIndicatorStyles)
286265
},
287266
beforeDestroy () {
288267
if (this.resizeObserver) {
289268
this.resizeObserver.disconnect()
290269
}
291270
292271
window.removeEventListener('resize', this.setIndicatorStyles)
272+
this.$refs.navigation.removeEventListener('transitionend', this.setIndicatorStyles)
293273
}
294274
})
295275
</script>

0 commit comments

Comments
 (0)