Commit 28026b3f6ffe67ddba15886d5cfba8bbf9a46a7c

Authored by Sergio Crisostomo
1 parent 4cccdf1f

Fix 3732 - add prop for capturing focus

Showing 1 changed file with 5 additions and 1 deletions   Show diff stats
src/components/tabs/tabs.vue
@@ -84,6 +84,10 @@ @@ -84,6 +84,10 @@
84 type: Boolean, 84 type: Boolean,
85 default: true 85 default: true
86 }, 86 },
  87 + captureFocus: {
  88 + type: Boolean,
  89 + default: false
  90 + },
87 closable: { 91 closable: {
88 type: Boolean, 92 type: Boolean,
89 default: false 93 default: false
@@ -376,7 +380,7 @@ @@ -376,7 +380,7 @@
376 [...this.$refs.panes.children].forEach((el, i) => { 380 [...this.$refs.panes.children].forEach((el, i) => {
377 if (index === i) { 381 if (index === i) {
378 [...el.children].forEach(child => child.style.visibility = 'visible'); 382 [...el.children].forEach(child => child.style.visibility = 'visible');
379 - setTimeout(() => focusFirst(el, el), transitionTime); 383 + if (this.captureFocus) setTimeout(() => focusFirst(el, el), transitionTime);
380 } else { 384 } else {
381 setTimeout(() => { 385 setTimeout(() => {
382 [...el.children].forEach(child => child.style.visibility = 'hidden'); 386 [...el.children].forEach(child => child.style.visibility = 'hidden');