Skip to content

Commit b0f1ae3

Browse files
committed
chore(combo): remove redundant touch callback call
1 parent 9706897 commit b0f1ae3

File tree

3 files changed

+4
-19
lines changed

3 files changed

+4
-19
lines changed

projects/igniteui-angular/src/lib/combo/combo.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<ng-content select="igx-hint, [igxHint]"></ng-content>
1010
</ng-container>
1111
<input igxInput #comboInput name="comboInput" type="text" [value]="value" readonly [attr.placeholder]="placeholder"
12-
[disabled]="disabled" (blur)="onBlur()" (focus)="onFocus()" />
12+
[disabled]="disabled" (blur)="onBlur()" />
1313
<ng-container ngProjectAs="igx-suffix">
1414
<ng-content select="igx-suffix"></ng-content>
1515
</ng-container>

projects/igniteui-angular/src/lib/combo/combo.component.spec.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,8 @@ describe('igxCombo', () => {
121121
spyOnProperty(combo, 'collapsed').and.returnValue(true);
122122
spyOnProperty(combo, 'valid', 'set');
123123

124-
combo.onFocus();
125-
expect(mockNgControl.registerOnTouchedCb).toHaveBeenCalledTimes(1);
126-
127124
combo.onBlur();
128-
expect(mockNgControl.registerOnTouchedCb).toHaveBeenCalledTimes(2);
125+
expect(mockNgControl.registerOnTouchedCb).toHaveBeenCalledTimes(1);
129126
});
130127
it('should correctly handle ngControl validity', () => {
131128
pending('Convert existing form test here');
@@ -2703,17 +2700,12 @@ describe('igxCombo', () => {
27032700
expect(model.touched).toBeTrue();
27042701
expect(model.dirty).toBeFalse();
27052702
}));
2706-
it('should have correctly bound focus and blur handlers', () => {
2707-
spyOn(combo, 'onFocus');
2703+
it('should have correctly bound blur handler', () => {
27082704
spyOn(combo, 'onBlur');
27092705

2710-
input.triggerEventHandler('focus', {});
2711-
expect(combo.onFocus).toHaveBeenCalled();
2712-
expect(combo.onFocus).toHaveBeenCalledWith();
2713-
27142706
input.triggerEventHandler('blur', {});
27152707
expect(combo.onBlur).toHaveBeenCalled();
2716-
expect(combo.onFocus).toHaveBeenCalledWith();
2708+
expect(combo.onBlur).toHaveBeenCalledWith();
27172709
});
27182710
});
27192711
});

projects/igniteui-angular/src/lib/combo/combo.component.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,13 +1215,6 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
12151215
}
12161216
}
12171217

1218-
/** @hidden @internal */
1219-
public onFocus() {
1220-
if (this.collapsed) {
1221-
this._onTouchedCallback();
1222-
}
1223-
}
1224-
12251218
/**
12261219
* @hidden @internal
12271220
*/

0 commit comments

Comments
 (0)