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

Feat: Form attribute of button with type submit #7892

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

suyash5053
Copy link
Contributor

Fixes #1456

Making a draft PR for the maintainers to review the process, if the approach looks good to you, will further work on this

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

@suyash5053 suyash5053 marked this pull request as ready for review March 7, 2025 18:56
@suyash5053 suyash5053 closed this Mar 7, 2025
@suyash5053 suyash5053 reopened this Mar 7, 2025
@suyash5053 suyash5053 marked this pull request as draft March 7, 2025 19:11
@suyash5053 suyash5053 marked this pull request as ready for review March 7, 2025 19:11
@suyash5053 suyash5053 requested a review from snowystinger March 10, 2025 19:33
@snowystinger
Copy link
Member

Looks like it is failing Typescript, I don't think you need to worry about form only being allowed on a submit button. For instance, I am pretty sure that 'reset' is also valid to have a form attribute.

Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for the updated prop, would you be willing to write a test for this? you can add one here https://github.com/adobe/react-spectrum/blob/main/packages/%40react-spectrum/button/test/Button.test.js

@suyash5053
Copy link
Contributor Author

I think, I'm missing something since the form id isn't getting passed to the button form prop, which is the reason my test cases are failing, I would take a day to look into this and finalize the test cases, and If I do not find a suitable approach or solution, I will require a bit of help. Thanks for your time.

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 this pull request may close these issues.

Add "form" attribute to buttons of type="submit"
2 participants