Declined
Last Updated: 10 Jun 2024 14:28 by ADMIN

Reproduceable example: https://blazorrepl.telerik.com/wSEgunbK46sVmd1p02

In my use case, I have custom components that wrap each of the telerik date controls (date picker, time picker, etc). They each expose a SelectedDate/SelectedTime/etc. bindable property. The SelectedDate is populated when the telerik control in my component (like TelerikDatePicker) fires OnChange. I use this instead of ValueChanged to avoid too many UI updates while the user selects a value in the UI, such as when typing. The OnChange event fires when the date input loses focus, but if the date input didn't have focus when the clear button is clicked, it never loses foucs and never fires OnChange. Let me know if this isn't intended to be supported and I should just be using ValueChanged instead, but to me OnChange would imply it would fire in all cases when the value can also change through ValueChanged, just less often.

Steps to reproduce (I used a TelerikDatePicker in the code above but I could reproduce this locally with date time picker and time picker - it's related to the underlying DateInput):

  • Enter a date into the date picker, either through typing or using the calendar popup
  • Cause the date picker to lose focus by clicking away
  • Click the clear button
  • Notice that the date is cleared from the UI control, but it doesn't call OnChange, so the date on the page never updates

When I discovered this locally, clicking the clear button would not clear the date visually from the date input as well as not updating the actual date variable. In the REPL, I was not able to replicate this - the date clears visually in the UI.