Hi.
I'm trying to clear data in a control if the user has entered an incomplete date. My ControlValueAccessor, which wraps a DateTimePicker, implements the following logic.
If the control contains a {incompleteDate: true} error and the input field loses focus, patchValue(null) is executed. However, the control still contains the error {incompleteDate: true}
I think not correct check in this line (libs/dateinputs/src/dateinput/dateinput.component.ts)
this.isDateIncomplete = this.kendoDateObject.hasValue() && this.value === null;
full method
private updateIncompleteValidationStatus(): void {
const previousValue = this.isDateIncomplete;
this.isDateIncomplete = this.kendoDateObject.hasValue() && this.value === null; // Not correct check
if (previousValue === this.isDateIncomplete || !this.incompleteDateValidation) { return; }
if (isPresent(this.ngControl) && !isPresent(this.pickerService)) {
this.cdr.markForCheck();
this.ngZone.run(() => this.onValidatorChange());
} else if (isPresent(this.pickerService)) {
this.pickerService.dateCompletenessChange.emit();
}
}
Installed packages
"@progress/kendo-angular-dateinputs": "15.4.0",
"@angular/core": "^16.2.12",
Live demo
Thanks for help.