@@ -18,7 +18,7 @@ import { IgxButtonModule } from '../directives/button/button.directive';
18
18
import { IgxForOfModule } from '../directives/for-of/for_of.directive' ;
19
19
import { IgxRippleModule } from '../directives/ripple/ripple.directive' ;
20
20
import { IgxTextSelectionModule } from '../directives/text-selection/text-selection.directive' ;
21
- import { IgxToggleDirective , IgxToggleModule } from '../directives/toggle/toggle.directive' ;
21
+ import { IgxToggleModule } from '../directives/toggle/toggle.directive' ;
22
22
import { IgxDropDownModule } from '../drop-down/public_api' ;
23
23
import { IgxIconModule , IgxIconService } from '../icon/public_api' ;
24
24
import { IgxInputGroupModule , IgxInputGroupType , IGX_INPUT_GROUP_TYPE } from '../input-group/public_api' ;
@@ -142,14 +142,7 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
142
142
143
143
/** @hidden @internal */
144
144
public ngAfterViewInit ( ) {
145
- this . dropdown . opened . pipe ( takeUntil ( this . destroy$ ) ) . subscribe ( ( ) => {
146
- if ( this . composing ) {
147
- this . comboInput . focus ( ) ;
148
- }
149
- if ( this . comboInput . value . length === 0 ) {
150
- this . dropdown . navigateFirst ( ) ;
151
- this . dropdownContainer . nativeElement . focus ( ) ;
152
- }
145
+ this . virtDir . contentSizeChange . pipe ( takeUntil ( this . destroy$ ) ) . subscribe ( ( ) => {
153
146
if ( this . selection . length > 0 ) {
154
147
const index = this . virtDir . igxForOf . findIndex ( e => {
155
148
let current = e [ this . valueKey ] ;
@@ -161,6 +154,15 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
161
154
this . dropdown . navigateItem ( index ) ;
162
155
}
163
156
} ) ;
157
+ this . dropdown . opened . pipe ( takeUntil ( this . destroy$ ) ) . subscribe ( ( ) => {
158
+ if ( this . composing ) {
159
+ this . comboInput . focus ( ) ;
160
+ }
161
+ if ( this . comboInput . value . length === 0 ) {
162
+ this . dropdown . navigateFirst ( ) ;
163
+ this . dropdownContainer . nativeElement . focus ( ) ;
164
+ }
165
+ } ) ;
164
166
this . dropdown . closed . pipe ( takeUntil ( this . destroy$ ) ) . subscribe ( ( ) => {
165
167
this . composing = false ;
166
168
} ) ;
@@ -220,6 +222,13 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
220
222
}
221
223
}
222
224
225
+ /** @hidden @internal */
226
+ public handleItemKeyDown ( event : KeyboardEvent ) {
227
+ if ( event . key === this . platformUtil . KEYMAP . ARROW_UP && event . altKey ) {
228
+ this . close ( ) ;
229
+ }
230
+ }
231
+
223
232
/** @hidden @internal */
224
233
public getEditElement ( ) : HTMLElement {
225
234
return this . comboInput . nativeElement ;
0 commit comments