-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Input value does not reset on context value reset #16
Comments
Hi @mkbctrl 👋 Thanks for your feedback. I think like you that it must be a bug. But I will try it myself to see. PR's are always welcome. |
Hey @mkbctrl, that's an odd bug. I'm using react-hook-form as well with a controller and it works fine for me. Could be that the <Controller
control={control}
name="availability"
render={({ field: { onChange, value }, formState: { errors } }) => (
<Datepicker
value={value}
onChange={onChange}
/>
)}
/> |
Thanks for investigating the issue 🎈. Funny, it disappeared automagically
👻 at some point.
When I wanted to tackle it on my own, everything was working perfectly. I
can’t argue I don’t like the situation. For once smth is actually easy
😄😄😄
I will reopen it if I will be able to recreate it or stumble upon it again
and I will be able to understand the underlying cause. Sounds good?
…On Tue, 20 Dec 2022 at 20:41, Noah Loomis ***@***.***> wrote:
Hey @mkbctrl <https://github.com/mkbctrl>, that's an odd bug. I'm using
react-hook-form as well with a controller and it works fine for me. Could
be that the useRange prop or placeholder is messing something up?
<Controller
control={control}
name="availability"
render={({ field: { onChange, value }, formState: { errors } }) => (
<Datepicker
value={value}
onChange={onChange}
/>
)}
/>
—
Reply to this email directly, view it on GitHub
<#16 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACNDTYTI2C5JZ2UDUZ5T5ITWOIDWNANCNFSM6AAAAAATCWIB4I>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@onesine this issue can be closed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am not 100% sure it's an issue, but it looks like one to me. I am using your component with ReactHookForm via Controller:
and when I attempt to reset the form values, the value inside the state gets cleared, but the value of the input does not.
Is it on purpose and I am not getting smth or it's a legit bug?
Here the recording when I clear the state values:
https://user-images.githubusercontent.com/10107362/208317554-2db7671f-cfb3-4bd4-a01d-8c44d1b4e299.mov
The text was updated successfully, but these errors were encountered: