@@ -71,7 +71,7 @@ export class ComboNavigationController<T extends object> {
71
71
return await this . combo . _show ( true ) ;
72
72
}
73
73
74
- public toggleSelect ( index : number ) : void {
74
+ protected _toggleSelection ( index : number ) : void {
75
75
// @ts -expect-error protected access
76
76
this . combo . toggleSelect ( index ) ;
77
77
}
@@ -88,7 +88,7 @@ export class ComboNavigationController<T extends object> {
88
88
89
89
const item = this . state . dataState [ this . _active ] ;
90
90
if ( ! item . header ) {
91
- this . toggleSelect ( this . _active ) ;
91
+ this . _toggleSelection ( this . _active ) ;
92
92
}
93
93
} ;
94
94
@@ -109,9 +109,11 @@ export class ComboNavigationController<T extends object> {
109
109
}
110
110
} ;
111
111
112
- private _onTab = async ( shiftKey ?: boolean ) : Promise < void > => {
112
+ private _onTab = async ( { shiftKey } : KeyboardEvent ) : Promise < void > => {
113
113
if ( this . combo . open ) {
114
114
if ( shiftKey ) {
115
+ // Move focus to the main input of the combo
116
+ // before the Shift+Tab behavior kicks in.
115
117
this . combo . focus ( ) ;
116
118
}
117
119
await this . _hide ( ) ;
@@ -122,6 +124,7 @@ export class ComboNavigationController<T extends object> {
122
124
if ( ! this . combo . open ) {
123
125
this . combo . clearSelection ( ) ;
124
126
}
127
+
125
128
if ( await this . _hide ( ) ) {
126
129
this . input . focus ( ) ;
127
130
}
@@ -213,8 +216,8 @@ export class ComboNavigationController<T extends object> {
213
216
214
217
// Combo
215
218
addKeybindings ( this . combo , { skip, bindingDefaults } )
216
- . set ( tabKey , ( ) => this . _onTab ( ) , { preventDefault : false } )
217
- . set ( [ shiftKey , tabKey ] , ( ) => this . _onTab ( true ) , {
219
+ . set ( tabKey , this . _onTab , { preventDefault : false } )
220
+ . set ( [ shiftKey , tabKey ] , this . _onTab , {
218
221
preventDefault : false ,
219
222
} )
220
223
. set ( escapeKey , this . _onEscape ) ;
0 commit comments