Declined
Last Updated: 23 Jul 2024 09:19 by ADMIN
Created by: Domingos Portela
Comments: 1
Category: DateTimePicker
Type: Bug Report
0

In the TelerikDatePicker, when I select the date and click outside, the event triggers one time only, but when I do the same inside the TelerikDateTimePicker it triggers two times (the first when I set the time and the second when I click outside).

In the end of the ticket I will provide a simple demo code used in Telerik REPL for Blazor comparing the behaviour between the two elements.

Additionally I would like to report the fact that in the TelerikDateTimePicker, when there's no value and I open the calendar and click "Set" without doing anything else, the DateTime is set to "01/01/0001 00:00" instead of null.

<TelerikDatePicker @bind-Value="@DatePickerValue" OnChange="@DatePickerHandler" Format="dd/MM/yyyy" />
DatePicker triggered @DatePickerTriggerCount time(s)
<br />
<br />
<TelerikDateTimePicker @bind-Value="@DateTimePickerValue" OnChange="@DateTimePickerHandler" Format="dd/MM/yyyy HH:mm" />
DateTimePicker triggered @DateTimePickerTriggerCount time(s)
@code {
    private int DatePickerTriggerCount { get; set; }
    private int DateTimePickerTriggerCount { get; set; }
    private DateTime? DatePickerValue { get; set; }
    private DateTime? DateTimePickerValue { get; set; }
    private void DatePickerHandler(object userInput)
    {
        DatePickerTriggerCount += 1;
    }
    private void DateTimePickerHandler(object userInput)
    {
        DateTimePickerTriggerCount += 1;
    }
}