-
Notifications
You must be signed in to change notification settings - Fork 913
Open
Description
Describe the bug
When using the datepicker time component - the valueChanged callback is only called when the OK button is pressed and not when clicking outside of the popup to close it. This also leaves the state in a confusing place because value
is not updated in the below example.
To Reproduce
Steps to reproduce the behavior:
- Using the basic Define Hour datepicker as a template: update the code to the following.
<RadzenLabel Text="Select Date" Component="DatePickerHourFormat" />
<RadzenDatePicker TValue=DateTime? Value=@value ValueChanged=@OnValueChanged ShowTime="true" HourFormat="12" DateFormat="MM/dd/yyyy h:mm tt" Name="DatePickerHourFormat" />
</RadzenStack>
<EventConsole @ref=@console />
@code {
DateTime? value = DateTime.Now;
EventConsole console;
private void OnValueChanged(DateTime? newValue)
{
console.Log(newValue);
value = newValue.Value;
}
}
- Open the datepicker, change the date. Observe that the console has logged the dateTime updating.
- Open the datepicker. Change the time using the up/down arrows on the UI. Close the datepicker by clicking outside of the modal. Observe that the console has not logged the new time.
- Repeat step 3, but close the datepicker by clicking the OK button instead. Observe that the console has logged the new time.
Expected behavior
When closing the modal without the OK button, the ValueChanged event should fire
Metadata
Metadata
Assignees
Labels
No labels