Pending Review
Last Updated: 17 Sep 2025 16:30 by Christopher
Christopher
Created on: 17 Sep 2025 16:30
Category: DatePicker
Type: Bug Report
0
Clearing the DatePicker input with a non-nullable DateTime property results in inconsistent state (with workaround)

When a DatePicker input is cleared by using the keyboard and the control loses focus, the state of a non-nullable DateTime property is inconsistent with the control. 

This behavior is appropriate; however, it can cause user confusion when the underlying value is used to query for data based on a value the user no longer sees.

My proposed solution (bug fix) is to return the value of the DatePicker to the last known good value when the control loses focus.

StateHasChanged() by itself does not cause a re-render of the component, however changing the @key value of the DatePicker does.

See this REPL for a demonstration of the issue and workaround/fix: https://blazorrepl.telerik.com/czEjvVlK18i471S622

 
0 comments