Inconsistent state with TimeField when input segment is cleared #1669
motherthestate
started this conversation in
Feature Requests / Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a problem where the TimeField does not call any change methods i.e. onValueChange, onPlaceholderChange, or bindings when clearing a segment. Since i validate my value outside of the component using zod, fully controlling the value, this allows the form to be submitted with a hidden value.
To reproduce, set the time value to 10:10. My state value is not new Time(10, 10). Now clear the minutes until the placeholder is shown. The component now shows 10:00, but my state is new Time(10, 1) since that was the last valid value that triggered change method.
Ive tried hacky ways of invalidating the field but since no change methods are called when a segment becomes empty it failed.
Am i missing something, or is this component just not compatible with my way of working?
Beta Was this translation helpful? Give feedback.
All reactions