Replies: 2 comments
-
Does the |
Beta Was this translation helpful? Give feedback.
0 replies
-
Try the following: <form
onSubmit={form.handleSubmit(onSubmit)}
id="unit-skill-dialog"
> <Button type="submit" form="unit-skill-dialog">
Submit
</Button> Add the id and form attributes to the and button on the inner RHF instance, and this will prevent the event from propagating to the parent, no need to usee.stopPropogation
|
Beta Was this translation helpful? Give feedback.
0 replies
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.
Uh oh!
There was an error while loading. Please reload this page.
-
So I have the following...
The Select Company component opens a sidebar where you can select a company, or add a new one. Once that is done it show what company is selected cleanly in the form.
The problem is that I have two nested Form Providers, and my SelectCompany is submitting the parent form.
I know your not suppose to nest form, and technically I am not because the child form is only temporary if your adding a new company and then its exhausted.
I am bit at a loss of what to do, I want to have one clean component that I can just insert and have all the functionality I need just like its any other input control.
One thing I thought was building a Context Provider and having multiple controls scattered (one in the form, and one outside of the form), but I really would like to have 1 control if possible so I don't have to wire up a bunch of state.
Anyone have any ideas around this?
Beta Was this translation helpful? Give feedback.
All reactions