@@ -18,7 +18,7 @@ import { IgxButtonModule } from '../directives/button/button.directive';
1818import { IgxForOfModule } from '../directives/for-of/for_of.directive' ;
1919import { IgxRippleModule } from '../directives/ripple/ripple.directive' ;
2020import { 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' ;
2222import { IgxDropDownModule } from '../drop-down/public_api' ;
2323import { IgxIconModule , IgxIconService } from '../icon/public_api' ;
2424import { IgxInputGroupModule , IgxInputGroupType , IGX_INPUT_GROUP_TYPE } from '../input-group/public_api' ;
@@ -142,14 +142,7 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
142142
143143 /** @hidden @internal */
144144 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 ( ( ) => {
153146 if ( this . selection . length > 0 ) {
154147 const index = this . virtDir . igxForOf . findIndex ( e => {
155148 let current = e [ this . valueKey ] ;
@@ -161,6 +154,15 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
161154 this . dropdown . navigateItem ( index ) ;
162155 }
163156 } ) ;
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+ } ) ;
164166 this . dropdown . closed . pipe ( takeUntil ( this . destroy$ ) ) . subscribe ( ( ) => {
165167 this . composing = false ;
166168 } ) ;
@@ -220,6 +222,13 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
220222 }
221223 }
222224
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+
223232 /** @hidden @internal */
224233 public getEditElement ( ) : HTMLElement {
225234 return this . comboInput . nativeElement ;
0 commit comments