From 3ce6b446d3793caf9f3e1885ccb78c2e740b84a3 Mon Sep 17 00:00:00 2001 From: Sergio Crisostomo Date: Fri, 18 May 2018 15:24:49 +0200 Subject: [PATCH] Use visibility instead of display --- src/components/tabs/tabs.vue | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/components/tabs/tabs.vue b/src/components/tabs/tabs.vue index 0a26740..294dbfc 100644 --- a/src/components/tabs/tabs.vue +++ b/src/components/tabs/tabs.vue @@ -146,7 +146,7 @@ }, barStyle () { let style = { - display: 'none', + visibility: 'hidden', width: `${this.barWidth}px` }; if (this.type === 'line') style.display = 'block'; @@ -388,14 +388,10 @@ const nextIndex = Math.max(this.navList.findIndex(tab => tab.name === this.focusedKey), 0); [...this.$refs.panes.children].forEach((el, i) => { if (nextIndex === i) { - [...el.children].forEach(child => child.style.display = 'block'); - setTimeout(() => { - focusFirst(el, el); - }, transitionTime); + [...el.children].forEach(child => child.style.visibility = 'visible'); + setTimeout(() => focusFirst(el, el), transitionTime); } else { - setTimeout(() => { - [...el.children].forEach(child => child.style.display = 'none'); - }, transitionTime); + [...el.children].forEach(child => child.style.visibility = 'hidden'); } }); } -- libgit2 0.21.4