handleTabKeyboardSelect add params init
So, when mounted, the event not emit.
This commit is contained in:
parent
38ab744203
commit
8b41022044
1 changed files with 3 additions and 2 deletions
|
@ -236,7 +236,8 @@
|
||||||
const nextTab = getNextTab(this.navList, this.focusedKey, direction);
|
const nextTab = getNextTab(this.navList, this.focusedKey, direction);
|
||||||
this.focusedKey = nextTab.name;
|
this.focusedKey = nextTab.name;
|
||||||
},
|
},
|
||||||
handleTabKeyboardSelect(){
|
handleTabKeyboardSelect(init = false){
|
||||||
|
if (init) return;
|
||||||
const focused = this.focusedKey || 0;
|
const focused = this.focusedKey || 0;
|
||||||
const index = this.navList.findIndex(({name}) => name === focused);
|
const index = this.navList.findIndex(({name}) => name === focused);
|
||||||
this.handleChange(index);
|
this.handleChange(index);
|
||||||
|
@ -416,7 +417,7 @@
|
||||||
this.mutationObserver.observe(hiddenParentNode, { attributes: true, childList: true, characterData: true, attributeFilter: ['style'] });
|
this.mutationObserver.observe(hiddenParentNode, { attributes: true, childList: true, characterData: true, attributeFilter: ['style'] });
|
||||||
}
|
}
|
||||||
|
|
||||||
this.handleTabKeyboardSelect();
|
this.handleTabKeyboardSelect(true);
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
this.observer.removeListener(this.$refs.navWrap, this.handleResize);
|
this.observer.removeListener(this.$refs.navWrap, this.handleResize);
|
||||||
|
|
Loading…
Add table
Reference in a new issue