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
SectionWrapper from SidebarList returns chakra.button which incorrectly has type='submit' by default. This triggers any form if nested within a FormProvider
#517
Closed
austinwoon opened this issue
Oct 10, 2023
· 0 comments
· Fixed by #518
In SectionWrapper we return the default HTML button element which has type=submit
This results in an unintended side-effect if Sidebar was rendered within a FormProvider as clicking any of the buttons would incorrectly trigger a submit action
To reproduce
Nest Sidebar within an instantiated FormProvider
Have an item be a button. In my case, i stated label to have SectionWrapper element render as a button
Click on button, see that form submit event triggers
Recommended fix
Forward a default prop for button for type=button
I tried to do this but could not find a clean way to forward props over without having to create 2 wrappers.
The text was updated successfully, but these errors were encountered:
In
SectionWrapper
we return the default HTML button element which hastype=submit
This results in an unintended side-effect if
Sidebar
was rendered within aFormProvider
as clicking any of the buttons would incorrectly trigger a submit actionTo reproduce
Sidebar
within an instantiatedFormProvider
label
to haveSectionWrapper
element render as a buttonRecommended fix
type=button
The text was updated successfully, but these errors were encountered: