Commit f0514906dba8f91ab0cfc195c1308d3bad99bbd4
Committed by
GitHub
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 | 146 | }, |
| 147 | 147 | barStyle () { |
| 148 | 148 | let style = { |
| 149 | - display: 'none', | |
| 149 | + visibility: 'hidden', | |
| 150 | 150 | width: `${this.barWidth}px` |
| 151 | 151 | }; |
| 152 | - if (this.type === 'line') style.display = 'block'; | |
| 152 | + if (this.type === 'line') style.visibility = 'visible'; | |
| 153 | 153 | if (this.animated) { |
| 154 | 154 | style.transform = `translate3d(${this.barOffset}px, 0px, 0px)`; |
| 155 | 155 | } else { |
| ... | ... | @@ -388,14 +388,10 @@ |
| 388 | 388 | const nextIndex = Math.max(this.navList.findIndex(tab => tab.name === this.focusedKey), 0); |
| 389 | 389 | [...this.$refs.panes.children].forEach((el, i) => { |
| 390 | 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 | 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 | } | ... | ... |