Merge pull request #3743 from SergioCrisostomo/tab-patches

Fix 3732 - add prop for capturing focus
This commit is contained in:
Aresn 2018-05-29 16:03:49 +08:00 committed by GitHub
commit cbff5e3641
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -84,6 +84,10 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
captureFocus: {
type: Boolean,
default: false
},
closable: { closable: {
type: Boolean, type: Boolean,
default: false default: false
@ -376,7 +380,7 @@
[...this.$refs.panes.children].forEach((el, i) => { [...this.$refs.panes.children].forEach((el, i) => {
if (index === i) { if (index === i) {
[...el.children].forEach(child => child.style.visibility = 'visible'); [...el.children].forEach(child => child.style.visibility = 'visible');
setTimeout(() => focusFirst(el, el), transitionTime); if (this.captureFocus) setTimeout(() => focusFirst(el, el), transitionTime);
} else { } else {
setTimeout(() => { setTimeout(() => {
[...el.children].forEach(child => child.style.visibility = 'hidden'); [...el.children].forEach(child => child.style.visibility = 'hidden');