Skip to content

fix: SplitButton.MenuButton will no longer submit forms#714

Merged
kurtdoherty merged 2 commits intomainfrom
fix-split-button-form-usage
Aug 26, 2025
Merged

fix: SplitButton.MenuButton will no longer submit forms#714
kurtdoherty merged 2 commits intomainfrom
fix-split-button-form-usage

Conversation

@kurtdoherty
Copy link
Contributor

@kurtdoherty kurtdoherty commented Aug 26, 2025

Context

The SplitButton.MenuButton does not have an explicit type attribute, which means it inherits the default of submit when used within a form. This means clicking the menu button will submit the form, which is unexpected (to say the least).

This PR

  • Updates SplitButton.MenuButton to always have type="button" explicitly set to avoid this behaviour.
  • Adds new busy prop to SplitButton to help ensure each button has the correct state when one of them is busy.
  • Adds new storybook docs for Button and SplitButton

note: Menu items container in the SplitButton's menu will behave like normal buttons in a form, submitting the form when clicked unless they're explicitly given type="button". It is unclear at this stage whether default behaviour of the web represents the happy path for our products or not.

Screenshot 2025-08-26 at 9 38 38 pm

@rpt-uk-github
Copy link

rpt-uk-github commented Aug 26, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

code/snyk check is complete. No issues have been found. (View Details)

@codacy-production
Copy link

codacy-production bot commented Aug 26, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 871d4b81 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (871d4b8) Report Missing Report Missing Report Missing
Head commit (48045a2) 8327 7691 92.36%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#714) 27 27 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

@kurtdoherty kurtdoherty marked this pull request as ready for review August 26, 2025 11:41
@kurtdoherty kurtdoherty merged commit 2f3a5d1 into main Aug 26, 2025
6 checks passed
@kurtdoherty kurtdoherty deleted the fix-split-button-form-usage branch August 26, 2025 11:42
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