Skip to content

Commit 1341ccc

Browse files
fix(IgxDatePicker): return when IE triggers input before focus
1 parent c52db60 commit 1341ccc

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

projects/igniteui-angular/src/lib/date-picker/date-picker.component.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,9 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
401401
private _cdr: ChangeDetectorRef,
402402
private _moduleRef: NgModuleRef<any>,
403403
private _injector: Injector,
404-
private _renderer: Renderer2) { }
404+
private _renderer: Renderer2) {
405+
}
406+
405407

406408
/**
407409
* Gets the input group template.
@@ -801,7 +803,7 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
801803
return this._inputGroup || this._inputGroupUserTemplate || null;
802804
}
803805

804-
/** @hidden @internal */
806+
/** @hidden @internal */
805807
public get inputDirective(): IgxInputDirective {
806808
return this._inputDirective || this._inputDirectiveUserTemplates.first || null;
807809
}
@@ -895,7 +897,7 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
895897

896898
this._inputDirectiveUserTemplates.changes.subscribe(() => {
897899
this.attachTemplateBlur();
898-
});
900+
});
899901
this.attachTemplateBlur();
900902
}
901903

@@ -911,8 +913,8 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
911913
this.rawDateString = (res.target as HTMLInputElement).value;
912914
this.onBlur(res, false);
913915
});
914-
// TODO: Refactor custom template handling.
915-
// Revise blur handling when custom template is passed
916+
// TODO: Refactor custom template handling.
917+
// Revise blur handling when custom template is passed
916918
}
917919
}
918920

@@ -1151,6 +1153,12 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
11511153

11521154
/** @hidden @internal */
11531155
public onInput(event) {
1156+
/**
1157+
* Fix for #8165 until refactoring (#6483).
1158+
* The IgxDateTimeEditor will be used to handle all inputs, i.e. this handler will be removed.
1159+
* It extends the IgxMaskDirective which contains logic that handles this issue.
1160+
*/
1161+
if (isIE() && !this._isInEditMode && !this.inputGroup.isFocused) { return; }
11541162
const targetValue = event.target.value;
11551163
const cursorPosition = this._getCursorPosition();
11561164
const checkInput = DatePickerUtil.checkForCompleteDateInput(this.dateFormatParts, targetValue);

0 commit comments

Comments
 (0)