Skip to content

Commit 5ee0309

Browse files
committed
chore(combo): remove redundant touch callback call
1 parent d275c08 commit 5ee0309

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
@@ -118,11 +118,8 @@ describe('igxCombo', () => {
118118
spyOnProperty(combo, 'collapsed').and.returnValue(true);
119119
spyOnProperty(combo, 'valid', 'set');
120120

121-
combo.onFocus();
122-
expect(mockNgControl.registerOnTouchedCb).toHaveBeenCalledTimes(1);
123-
124121
combo.onBlur();
125-
expect(mockNgControl.registerOnTouchedCb).toHaveBeenCalledTimes(2);
122+
expect(mockNgControl.registerOnTouchedCb).toHaveBeenCalledTimes(1);
126123
});
127124
it('should correctly handle ngControl validity', () => {
128125
pending('Convert existing form test here');
@@ -2649,17 +2646,12 @@ describe('igxCombo', () => {
26492646
expect(model.touched).toBeTrue();
26502647
expect(model.dirty).toBeFalse();
26512648
}));
2652-
it('should have correctly bound focus and blur handlers', () => {
2653-
spyOn(combo, 'onFocus');
2649+
it('should have correctly bound blur handler', () => {
26542650
spyOn(combo, 'onBlur');
26552651

2656-
input.triggerEventHandler('focus', {});
2657-
expect(combo.onFocus).toHaveBeenCalled();
2658-
expect(combo.onFocus).toHaveBeenCalledWith();
2659-
26602652
input.triggerEventHandler('blur', {});
26612653
expect(combo.onBlur).toHaveBeenCalled();
2662-
expect(combo.onFocus).toHaveBeenCalledWith();
2654+
expect(combo.onBlur).toHaveBeenCalledWith();
26632655
});
26642656
});
26652657
});

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,13 +1176,6 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
11761176
}
11771177
}
11781178

1179-
/** @hidden @internal */
1180-
public onFocus() {
1181-
if (this.collapsed) {
1182-
this._onTouchedCallback();
1183-
}
1184-
}
1185-
11861179
/**
11871180
* @hidden @internal
11881181
*/

0 commit comments

Comments
 (0)