@@ -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 { IgxToggleModule } from '../directives/toggle/toggle.directive' ;
21+ import { IgxToggleDirective , 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' ;
@@ -147,9 +147,19 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
147147 this . comboInput . focus ( ) ;
148148 }
149149 if ( this . comboInput . value . length === 0 ) {
150- this . dropdown . focusedItem = this . dropdown . items [ 0 ] ;
150+ this . dropdown . navigateFirst ( ) ;
151151 this . dropdownContainer . nativeElement . focus ( ) ;
152152 }
153+ if ( this . selection . length > 0 ) {
154+ const index = this . virtDir . igxForOf . findIndex ( e => {
155+ let current = e [ this . valueKey ] ;
156+ if ( this . valueKey === null || this . valueKey === undefined ) {
157+ current = e ;
158+ }
159+ return current === this . selection [ 0 ] ;
160+ } ) ;
161+ this . dropdown . navigateItem ( index ) ;
162+ }
153163 } ) ;
154164 this . dropdown . closed . pipe ( takeUntil ( this . destroy$ ) ) . subscribe ( ( ) => {
155165 this . composing = false ;
@@ -169,7 +179,7 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
169179 this . _onChangeCallback ( this . searchValue ) ;
170180 if ( this . collapsed ) {
171181 this . open ( ) ;
172- this . virtDir . scrollTo ( 0 ) ;
182+ this . dropdown . navigateFirst ( ) ;
173183 }
174184 super . handleInputChange ( event ) ;
175185 }
@@ -223,6 +233,7 @@ export class IgxSimpleComboComponent extends IgxComboBaseDirective implements Co
223233 this . clearSelection ( true ) ;
224234 if ( this . collapsed ) {
225235 this . open ( ) ;
236+ this . dropdown . navigateFirst ( ) ;
226237 } else {
227238 this . focusSearchInput ( true ) ;
228239 }
0 commit comments