Commit f0514906dba8f91ab0cfc195c1308d3bad99bbd4

Authored by Aresn
Committed by GitHub
2 parents 82278172 e906d570

Merge pull request #3652 from SergioCrisostomo/tabs-keyboard

Use visibility instead of display
Showing 1 changed file with 5 additions and 9 deletions   Show diff stats
src/components/tabs/tabs.vue
@@ -146,10 +146,10 @@ @@ -146,10 +146,10 @@
146 }, 146 },
147 barStyle () { 147 barStyle () {
148 let style = { 148 let style = {
149 - display: 'none', 149 + visibility: 'hidden',
150 width: `${this.barWidth}px` 150 width: `${this.barWidth}px`
151 }; 151 };
152 - if (this.type === 'line') style.display = 'block'; 152 + if (this.type === 'line') style.visibility = 'visible';
153 if (this.animated) { 153 if (this.animated) {
154 style.transform = `translate3d(${this.barOffset}px, 0px, 0px)`; 154 style.transform = `translate3d(${this.barOffset}px, 0px, 0px)`;
155 } else { 155 } else {
@@ -388,14 +388,10 @@ @@ -388,14 +388,10 @@
388 const nextIndex = Math.max(this.navList.findIndex(tab => tab.name === this.focusedKey), 0); 388 const nextIndex = Math.max(this.navList.findIndex(tab => tab.name === this.focusedKey), 0);
389 [...this.$refs.panes.children].forEach((el, i) => { 389 [...this.$refs.panes.children].forEach((el, i) => {
390 if (nextIndex === i) { 390 if (nextIndex === i) {
391 - [...el.children].forEach(child => child.style.display = 'block');  
392 - setTimeout(() => {  
393 - focusFirst(el, el);  
394 - }, transitionTime); 391 + [...el.children].forEach(child => child.style.visibility = 'visible');
  392 + setTimeout(() => focusFirst(el, el), transitionTime);
395 } else { 393 } else {
396 - setTimeout(() => {  
397 - [...el.children].forEach(child => child.style.display = 'none');  
398 - }, transitionTime); 394 + [...el.children].forEach(child => child.style.visibility = 'hidden');
399 } 395 }
400 }); 396 });
401 } 397 }