When setting the Checkbox component to disabled while the form is marked as touched, the k-invalid class is applied to the checkbox control.
That's because of the implementation of the isControlInvalid property:
public get isControlInvalid(): boolean {
return this.control && this.control.touched && !this.control.valid;
}
According to the Angular source code:
/**
* A control is `valid` when its `status` is `VALID`.
*
* @see {@link AbstractControl.status}
*
* @returns True if the control has passed all of its validation tests,
* false otherwise.
*/
get valid(): boolean;
So valid() returns false when `status` is DISABLED.
The `isControlInvalid`property should better implemented like this:
public get isControlInvalid(): boolean {
return this.control && this.control.touched && this.control.invalid;
}
Please check this Stackblitz: https://stackblitz.com/edit/angular-dznoe1xj?file=src%2Fapp%2Fapp.component.ts
Hi Holger,
The fix is released in the dev version 20.1.0-develop.20.
https://www.telerik.com/kendo-angular-ui/components/installation/development-builds
This week or next one we will release an official version as well. Will be available here:
https://www.telerik.com/kendo-angular-ui/components/changelogs/kendo-angular-ui
Regards,
Martin Bechev
Progress Telerik
Hello Holger,
Thank you for the provided feedback.
We will look into this case and consider your suggestion. Once there is any update on the case, I will let you know here (by the end of the week).
As a token of gratitude for reporting this and for the time spent getting to know the source code, I updated your Telerik points.
Regards,
Martin Bechev
Progress Telerik