Merge pull request #3652 from SergioCrisostomo/tabs-keyboard

Use visibility instead of display
This commit is contained in:
Aresn 2018-05-21 11:11:16 +08:00 committed by GitHub
commit f0514906db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -146,10 +146,10 @@
},
barStyle () {
let style = {
display: 'none',
visibility: 'hidden',
width: `${this.barWidth}px`
};
if (this.type === 'line') style.display = 'block';
if (this.type === 'line') style.visibility = 'visible';
if (this.animated) {
style.transform = `translate3d(${this.barOffset}px, 0px, 0px)`;
} else {
@ -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');
}
});
}