Skip to content

Conversation

@sai6855
Copy link
Contributor

@sai6855 sai6855 commented Nov 5, 2025

@sai6855 sai6855 added type: bug It doesn't behave as expected. scope: button Changes related to the button. package: material-ui Specific to Material UI. labels Nov 5, 2025
@mui-bot
Copy link

mui-bot commented Nov 5, 2025

Netlify deploy preview

https://deploy-preview-47185--material-ui.netlify.app/

Bundle size report

Bundle Parsed size Gzip size
@mui/material 🔺+33B(+0.01%) 🔺+14B(+0.01%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against e23d6d9

@sai6855 sai6855 requested a review from siriwatknp November 5, 2025 06:25
if (ComponentProp === 'button') {
buttonProps.type = type === undefined ? 'button' : type;
// Don't default to 'button' if form attributes are present, to allow form submission
const hasFormAttributes = !!other.formAction;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ButtonBase was defaulting to type="button" when no type prop was provided, which prevented form submission and broke formAction functionality. The fix checks for form-related attributes and skips the default type to allow the browser's natural submit behavior (type="submit").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: material-ui Specific to Material UI. scope: button Changes related to the button. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

formAction on Button does not support React 19 behaviours

2 participants