Shopify / ui-extensions

MIT License
268 stars 36 forks source link

Unable to submit Form: Missing 'type' and 'form' Attributes in Button component #1272

Open ivorpad opened 1 year ago

ivorpad commented 1 year ago

Please list the package(s) involved in the issue, and include the version you are using

@shopify/ui-extensions-react/admin

Describe the bug

Currently, the Form component does not allow for easy customization of the submit button, as it renders an implicit submit behavior without a customizable button. It would be highly beneficial if developers could either customize the text of the implicit submit button or insert their own Button component that integrates seamlessly with the form's submission behavior, unfortunately Button comes with type=button by default and we can't change it. This flexibility would enhance both the UI consistency and the user experience, particularly for cases where customized buttons (with icons or specific styles) are needed for form actions.

Steps to reproduce the behavior:

  1. Create an admin extension using the Form example: Form example
  2. Add a Button component or an AdminAction with a Button as primaryAction.
  3. Try to submit.

Expected behavior

The form should be submitted as intended.

Ideal outcome

mmatila commented 2 months ago

Would really like this to be implemented. Is there literally any way to submit a form?