File tree Expand file tree Collapse file tree 3 files changed +8
-13
lines changed
projects/igniteui-angular/src/lib/combo Expand file tree Collapse file tree 3 files changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -1206,15 +1206,15 @@ export abstract class IgxComboBaseDirective extends DisplayDensityBase implement
12061206 this . searchValue = '' ;
12071207 if ( ! e . event ) {
12081208 this . comboInput ?. nativeElement . focus ( ) ;
1209+ } else {
1210+ this . _onTouchedCallback ( ) ;
1211+ this . updateValidity ( ) ;
12091212 }
12101213 }
12111214
12121215 /** @hidden @internal */
12131216 public handleClosed ( ) {
12141217 this . closed . emit ( { owner : this } ) ;
1215- if ( this . comboInput . nativeElement !== document . activeElement ) {
1216- this . validateComboState ( ) ;
1217- }
12181218 }
12191219
12201220 /** @hidden @internal */
@@ -1254,15 +1254,10 @@ export abstract class IgxComboBaseDirective extends DisplayDensityBase implement
12541254 public onBlur ( ) {
12551255 if ( this . collapsed ) {
12561256 this . _onTouchedCallback ( ) ;
1257- this . validateComboState ( ) ;
1257+ this . updateValidity ( ) ;
12581258 }
12591259 }
12601260
1261- /** @hidden @internal */
1262- public onFocus ( ) : void {
1263- this . _onTouchedCallback ( ) ;
1264- }
1265-
12661261 /** @hidden @internal */
12671262 public setActiveDescendant ( ) : void {
12681263 this . activeDescendant = this . dropdown . focusedItem ?. id || '' ;
@@ -1287,7 +1282,7 @@ export abstract class IgxComboBaseDirective extends DisplayDensityBase implement
12871282 this . manageRequiredAsterisk ( ) ;
12881283 } ;
12891284
1290- private validateComboState ( ) {
1285+ private updateValidity ( ) {
12911286 if ( this . ngControl && this . ngControl . invalid ) {
12921287 this . valid = IgxInputState . INVALID ;
12931288 } else {
Original file line number Diff line number Diff line change 1313 role ="combobox " aria-haspopup ="listbox "
1414 [attr.aria-expanded] ="!dropdown.collapsed " [attr.aria-controls] ="dropdown.listId "
1515 [attr.aria-labelledby] ="ariaLabelledBy || label?.id || placeholder "
16- (blur) ="onBlur() "
17- (focus) ="onFocus() " />
16+ (blur) ="onBlur() " />
1817 < ng-container ngProjectAs ="igx-suffix ">
1918 < ng-content select ="igx-suffix "> </ ng-content >
2019 </ ng-container >
Original file line number Diff line number Diff line change @@ -3425,7 +3425,8 @@ describe('igxCombo', () => {
34253425 combo . open ( ) ;
34263426 input . triggerEventHandler ( 'focus' , { } ) ;
34273427 fixture . detectChanges ( ) ;
3428- expect ( ngModel . touched ) . toBeTrue ( ) ;
3428+ expect ( ngModel . touched ) . toBeFalse ( ) ;
3429+ fixture . detectChanges ( ) ;
34293430 const documentClickEvent = new MouseEvent ( 'click' , { bubbles : true } ) ;
34303431 document . body . dispatchEvent ( documentClickEvent ) ;
34313432 fixture . detectChanges ( ) ;
You can’t perform that action at this time.
0 commit comments