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 trying to make reusable components to use in RHF using MUI. I'm using the FormProvider to pass control element to the components. I'm having a strange issue with the MUI checkbox however.
After first click on the checkbox every change now requires two clicks, this is not true if I click on the label. So the label toggles state correctly but the checkbox only works on every other click.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to make reusable components to use in RHF using MUI. I'm using the FormProvider to pass control element to the components. I'm having a strange issue with the MUI checkbox however.
After first click on the checkbox every change now requires two clicks, this is not true if I click on the label. So the label toggles state correctly but the checkbox only works on every other click.
Here is a Code Sandbox
This is my component
And how I use it
EDIT:
On closer inspection it seems to be related to using
OnChange
instead ofOnSubmit
Beta Was this translation helpful? Give feedback.
All reactions