TimePicker bound to a non-nullable DateTime property. User input is marked as invalid, when they change only part of the default TimePicker value.
On beginning to type, the k-invalid class is applied to the TimePicker element. When the use clicks away, the current input value (e.g., 3:00 AM) is replaced with the default value (12:00 AM).
If you type the whole value (e.g., 3:45 AM) and then click away from the component, the k-invalid class is removed and the value is accepted as valid.
The k-invalid class should not be applied to the TimePicker in the scenario described above. The used should be able to change only the hour part of the value, or the minutes, without having to type in the whole value.
All
8.1.1
Hello,
Closing the issue as Declined. Тhe new behavior is intended. The validation is supposed to trigger when you have the TimePicker bound to a non-nullable DateTime field that is not initialized and you try to change the value. See this example: https://blazorrepl.telerik.com/QJaUFDFw05LBs4Fe22
Note the initial value of DateValue: 1/1/0001 12:00:00 AM, specifically the date (0001).
The built-in validation is supposed to trigger because the accepted date is between 1900-2099. Thus, 0001 falls outside of this range and any change to the time part of the picker should result in the validation triggering and resetting the value. The behavior is consistent with that of the other pickers in the example linked above.
To work around the issue with the validation when attempting to change the value, we would suggest binding the TimePicker to a property that is initialized: https://blazorrepl.telerik.com/GzuglNPH27FkhKYI47
So instead of 1/1/0001 12:00:00 AM, the initial value of DateValue will be: 1/1/1900 12:00:00 AM, which does not fail the validation when the user attempts to modify the time part.
Regards,
Ivan Danchev
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.