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
Describe the bug
I'm trying to make use of the DatePicker component with react-hook-form. However I'm running into the following issue: the date input element shows the changed value (e.g 13-08-2022), but on submit it logs the initial value (15-07-2022).
Expected behavior
I would expect the displayed (changed) value to be logged on submit in the example given above.
Desktop (please complete the following information):
OS: Kubuntu
Browser: Firefox
Version: 102.0
Additional context
I tried other variations to check whether it might be a react-hook-form, an ASC component or a DatePicker component issue. So far, it appears to be an issue with the DatePicker component, because the variations listed below all work as expected. So, the input element shows the changed value, and the changed value is also logged on submit.
import{useForm}from"react-hook-form"import{Input}from'@amsterdam/asc-ui'exportdefaultfunctionTheForm(){const{ register, handleSubmit,formState: { errors }}=useForm()constonSubmit=data=>console.log(data)return(<formonSubmit={handleSubmit(onSubmit)}>{/* HTML5 date input based on ASC Input component */}<InputdefaultValue="2022-07-16"type="date"{...register('theHtmlDate')}/>{/* Plain ASC input */}<InputdefaultValue="testing asc"{...register('exampleAsc')}/>{/* Plain HTML input */}<inputdefaultValue="testing html"{...register('exampleHtml')}/><inputtype="submit"/></form>)}
Do you have any idea what I am missing in case of the DatePicker component? Can you point me in right direction?
Thanks!
The text was updated successfully, but these errors were encountered:
Describe the bug
I'm trying to make use of the
DatePicker
component withreact-hook-form
. However I'm running into the following issue: the date input element shows the changed value (e.g13-08-2022
), but on submit it logs the initial value (15-07-2022
).To Reproduce
A minimal example to illustrate - based on the react-hook-form quickstart:
Expected behavior
I would expect the displayed (changed) value to be logged on submit in the example given above.
Desktop (please complete the following information):
Additional context
I tried other variations to check whether it might be a react-hook-form, an ASC component or a DatePicker component issue. So far, it appears to be an issue with the DatePicker component, because the variations listed below all work as expected. So, the input element shows the changed value, and the changed value is also logged on submit.
Do you have any idea what I am missing in case of the DatePicker component? Can you point me in right direction?
Thanks!
The text was updated successfully, but these errors were encountered: