A few issues: The DatePicker allows any key to be pressed and is accepted. Also any number of characters are allowed. The value clears when moving off the control, I'm sure because the value cannot be converted to a Date or DateTime. Why are invalid keys allowed? How can I prevent this from happening?
This is how the components works at the moment - if you have suggestions for improvements feel free to submit pull request!
Ok. That's good to know, but how about my second question. Are you saying it's not possible to prevent invalid keys from being entered?
Yes, this is exactly what I was saying.
You can also consider disabling all key input in the datepicker by setting the AllowInput attribute to false:
<RadzenDatePicker AllowInput="false" ... />
Again, good to know. However, my users want to be able to key in dates and times. While you can do this with this control (it's actually pretty good at figuring out what the user wants), allowing the entry of non-numeric keys is a breaking feature. I cannot use the control as it is. I really don't want to use another library.
How do I submit a pull request?
To be honest I don't think all non-numeric input should be ignored. There are valid dates that contain non-numeric characters. A few examples:
"May-10-2024"
"10/10/2024"
A .NET Date can have many formats which are all supported by the parsing algorithm.
Agreed. However, when I subject the control to a format, the input should match.