Declined
Last Updated: 19 Jun 2025 14:01 by ADMIN
Amanatios Amanatidis
Created on: 06 Jun 2025 14:14
Category: TimePicker
Type: Bug Report
2
TimePicker validation triggered on attempting to change its default value

Description

TimePicker bound to a non-nullable DateTime property. User input is marked as invalid, when they change only part of the default TimePicker value.

Steps To Reproduce

  1. Run the following REPL example: https://blazorrepl.telerik.com/GpEUOflI50gehA9B54
  2. Focus the hour part of the input and type in a number, e.g., 3
  3. Blur the TimePicker

Actual Behavior

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.

Expected Behavior

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.

Browser

All

Last working version of Telerik UI for Blazor (if regression)

8.1.1

1 comment
ADMIN
Ivan Danchev
Posted on: 19 Jun 2025 13:49

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.