You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm experiencing an issue with the HeroUI DatePicker component when users manually edit the date input. Specifically, if a user selects a valid date via the DatePicker and then manually clears one of the segments (e.g., day, month, or year), the component returns null instead of preserving the raw, incomplete input.
Steps to Reproduce
Render the HeroUI DatePicker in a React application.
Use the DatePicker UI to select a valid date (for example, 2000-02-02).
Manually delete one of the segments (e.g., clear the day or month).
Observe that the onChange handler receives null as the value.
Expected Behavior
When a user manually edits the input resulting in an incomplete date (e.g., missing day, month, or year), the DatePicker should return the raw input as a string so that the validation logic can detect the incomplete value and flag it as invalid.
Alternatively, there should be a configuration option that allows developers to always receive the raw input value (even if incomplete) rather than null.
Actual Behavior
If a segment is cleared (for example, after selecting a valid date, deleting the day), the DatePicker returns null.
This behavior prevents developers from distinguishing between a completely empty input and an incomplete, manually-edited input, which in turn hinders proper validation.
Impact
Due to this behavior, my form validation cannot differentiate between a field that is intentionally left empty and one that contains an incomplete date (e.g., "2000-02-" when the day is removed). This results in validation not triggering as expected for incomplete manual entries.
Additional Context
I have attempted to work around this issue by capturing the raw input using an onInput listener and custom onChange handlers, but these approaches are not reliable due to the internal workings of the DatePicker.
The problem seems to stem from the DatePicker interpreting any incomplete date as null, thereby discarding the user's partial input.
Any assistance or guidance on how to resolve or work around this issue would be greatly appreciated.
Thank you!
The text was updated successfully, but these errors were encountered:
I'm experiencing an issue with the HeroUI DatePicker component when users manually edit the date input. Specifically, if a user selects a valid date via the DatePicker and then manually clears one of the segments (e.g., day, month, or year), the component returns
null
instead of preserving the raw, incomplete input.Steps to Reproduce
2000-02-02
).onChange
handler receivesnull
as the value.Expected Behavior
null
.Actual Behavior
null
.Impact
Due to this behavior, my form validation cannot differentiate between a field that is intentionally left empty and one that contains an incomplete date (e.g., "2000-02-" when the day is removed). This results in validation not triggering as expected for incomplete manual entries.
Additional Context
onInput
listener and customonChange
handlers, but these approaches are not reliable due to the internal workings of the DatePicker.null
, thereby discarding the user's partial input.Any assistance or guidance on how to resolve or work around this issue would be greatly appreciated.
Thank you!
The text was updated successfully, but these errors were encountered: