Closed coleweinman closed 1 month ago
Thanks for pointing this out, @coleweinman. This will be fixed in the next package release.
@sadik-malik I'm still getting this error on the latest update. Looks like the fix checks if the value is null but in this case the value is a string. It needs to be transformed using the transform.input function to validate correct?
@coleweinman, string values were being passed to the validation function because they were not falsy. I have raised a PR to convert string values to Date objects before passing them to the validation function.
For now, please use a day.js Date
object instead of a string.
Duplicates
Latest version
Current behavior šÆ
Currently when a DatePickerElement takes an initial value of a string, the form will error when trying to submit.
Expected behavior š¤
If the DatePickerElement is provided a string value, the date picker should correctly validate and display the date.
Steps to reproduce š¹
Steps:
https://stackblitz.com/edit/github-hxddty-k8d1km?file=src%2FApp.tsx
Note: I also tried modifying the input and output function (currently commented out) however this didn't fix the issue.