From 8edccb1b5ad4c0a18936ced47d784b4fc3add39b Mon Sep 17 00:00:00 2001 From: VdustR Date: Fri, 2 Feb 2018 10:29:49 +0800 Subject: [PATCH] fix(MdTabs): correct indicator position on transition end fix #1432 --- src/components/MdTabs/MdTabs.vue | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/src/components/MdTabs/MdTabs.vue b/src/components/MdTabs/MdTabs.vue index 0175939fd..f85d0892f 100644 --- a/src/components/MdTabs/MdTabs.vue +++ b/src/components/MdTabs/MdTabs.vue @@ -76,8 +76,7 @@ hasContent: false, MdTabs: { items: {} - }, - alignmentChanging: false + } }), provide () { return { @@ -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: { @@ -283,6 +260,8 @@ this.setupWatchers() }, 100) }) + + this.$refs.navigation.addEventListener('transitionend', this.setIndicatorStyles) }, beforeDestroy () { if (this.resizeObserver) { @@ -290,6 +269,7 @@ } window.removeEventListener('resize', this.setIndicatorStyles) + this.$refs.navigation.removeEventListener('transitionend', this.setIndicatorStyles) } })