@@ -658,12 +658,6 @@ export default baseMixins.extend<options>().extend({
658
658
const keyCode = e . keyCode
659
659
const menu = this . $refs . menu
660
660
661
- // If enter, space, open menu
662
- if ( [
663
- keyCodes . enter ,
664
- keyCodes . space ,
665
- ] . includes ( keyCode ) ) this . activateMenu ( )
666
-
667
661
this . $emit ( 'keydown' , e )
668
662
669
663
if ( ! menu ) return
@@ -677,6 +671,12 @@ export default baseMixins.extend<options>().extend({
677
671
} )
678
672
}
679
673
674
+ // If enter, space, open menu
675
+ if ( [
676
+ keyCodes . enter ,
677
+ keyCodes . space ,
678
+ ] . includes ( keyCode ) ) this . activateMenu ( )
679
+
680
680
// If menu is not active, up/down/home/end can do
681
681
// one of 2 things. If multiple, opens the
682
682
// menu, if not, will cycle through all
@@ -709,6 +709,7 @@ export default baseMixins.extend<options>().extend({
709
709
if ( ! menu || ! this . isDirty ) return
710
710
711
711
// When menu opens, set index of first active item
712
+ this . $refs . menu . getTiles ( )
712
713
for ( let i = 0 ; i < menu . tiles . length ; i ++ ) {
713
714
if ( menu . tiles [ i ] . getAttribute ( 'aria-selected' ) === 'true' ) {
714
715
this . setMenuIndex ( i )
@@ -839,11 +840,6 @@ export default baseMixins.extend<options>().extend({
839
840
( this . $refs . menu as { [ key : string ] : any } ) . updateDimensions ( )
840
841
} )
841
842
842
- // We only need to reset list index for multiple
843
- // to keep highlight when an item is toggled
844
- // on and off
845
- if ( ! this . multiple ) return
846
-
847
843
const listIndex = this . getMenuIndex ( )
848
844
849
845
this . setMenuIndex ( - 1 )
0 commit comments