File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
projects/igniteui-angular/src/lib/combo Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -2577,6 +2577,7 @@ describe('igxCombo', () => {
25772577 expect ( combo . valid ) . toEqual ( IgxComboState . INVALID ) ;
25782578 expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INVALID ) ;
25792579
2580+ input . triggerEventHandler ( 'focus' , { } ) ;
25802581 combo . selectAllItems ( ) ;
25812582 fixture . detectChanges ( ) ;
25822583 expect ( combo . valid ) . toEqual ( IgxComboState . VALID ) ;
@@ -2636,6 +2637,17 @@ describe('igxCombo', () => {
26362637 expect ( model . valid ) . toBeFalse ( ) ;
26372638 expect ( model . touched ) . toBeTrue ( ) ;
26382639 expect ( model . dirty ) . toBeFalse ( ) ;
2640+
2641+ fixture . componentInstance . values = [ 'New Jersey' ] ;
2642+ fixture . detectChanges ( ) ;
2643+ tick ( ) ;
2644+ expect ( combo . valid ) . toEqual ( IgxComboState . INITIAL ) ;
2645+ expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INITIAL ) ;
2646+ expect ( combo . selectedItems ( ) ) . toEqual ( [ 'New Jersey' ] ) ;
2647+ expect ( combo . value ) . toEqual ( 'New Jersey' ) ;
2648+ expect ( model . valid ) . toBeTrue ( ) ;
2649+ expect ( model . touched ) . toBeTrue ( ) ;
2650+ expect ( model . dirty ) . toBeFalse ( ) ;
26392651 } ) ) ;
26402652 it ( 'should have correctly bound focus and blur handlers' , ( ) => {
26412653 spyOn ( combo , 'onFocus' ) ;
Original file line number Diff line number Diff line change @@ -1145,7 +1145,11 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
11451145 protected onStatusChanged = ( ) => {
11461146 if ( ( this . ngControl . control . touched || this . ngControl . control . dirty ) &&
11471147 ( this . ngControl . control . validator || this . ngControl . control . asyncValidator ) ) {
1148- this . valid = this . ngControl . valid ? IgxComboState . VALID : IgxComboState . INVALID ;
1148+ if ( ! this . collapsed || this . inputGroup . isFocused ) {
1149+ this . valid = this . ngControl . valid ? IgxComboState . VALID : IgxComboState . INVALID ;
1150+ } else {
1151+ this . valid = this . ngControl . valid ? IgxComboState . INITIAL : IgxComboState . INVALID ;
1152+ }
11491153 }
11501154 this . manageRequiredAsterisk ( ) ;
11511155 }
You can’t perform that action at this time.
0 commit comments