fix: SplitButton.MenuButton will no longer submit forms#714
fix: SplitButton.MenuButton will no longer submit forms#714kurtdoherty merged 2 commits intomainfrom
SplitButton.MenuButton will no longer submit forms#714Conversation
🎉 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) |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesFootnotes
|
Context
The
SplitButton.MenuButtondoes not have an explicittypeattribute, which means it inherits the default ofsubmitwhen used within a form. This means clicking the menu button will submit the form, which is unexpected (to say the least).This PR
SplitButton.MenuButtonto always havetype="button"explicitly set to avoid this behaviour.busyprop toSplitButtonto help ensure each button has the correct state when one of them is busy.ButtonandSplitButtonnote: 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.