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

added default button type to switch button to prevent submit when included in form #5841

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

Conversation

dwsosa
Copy link

@dwsosa dwsosa commented Mar 29, 2025

Closes # 5823
#5823

Added a variable to the switch button interface and added a default value of "button" so that the toggleswitch component doesnt default to "submit" which is an issue when the toggleswitch is added to a form

Changelog

New

Changed

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

Jest test result to confirm the type attribute has value "button"
testsuite

@dwsosa dwsosa requested a review from a team as a code owner March 29, 2025 04:42
@dwsosa dwsosa requested a review from jonrohan March 29, 2025 04:42
Copy link

changeset-bot bot commented Mar 29, 2025

🦋 Changeset detected

Latest commit: d8d938a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dwsosa
Copy link
Author

dwsosa commented Mar 29, 2025

This PR implements the change for the ToggleSwitch default behavior to act as a button rather than a submit button. I haven't added the full test suite yet, and I'm looking for guidance on what tests would be most valuable for this change. I'm eager to iterate based on your feedback.

dwsosa and others added 5 commits March 29, 2025 17:17
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.

2 participants