Skip to content
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

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

Comments

@austinwoon
Copy link
Contributor

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant