Skip to content

[stepper] Stop forwarding elevation and square to the DOM - #49987

Open
siriwatknp wants to merge 1 commit into
mui:masterfrom
siriwatknp:stepper-paper-props-dom
Open

siriwatknp wants to merge 1 commit into
mui:masterfrom
siriwatknp:stepper-paper-props-dom

Conversation

@siriwatknp

Copy link
Copy Markdown
Member

Summary

Stepper renders elevation and square as HTML attributes on its <ol> root. <Stepper elevation={3} square> produces <ol elevation="3" square>, and React logs a warning:

Received `true` for a non-boolean attribute `square`.

The two props are left over from when Stepper rendered a Paper. #22564 removed the Paper, but StepperProps still picks elevation and square from PaperProps, so TypeScript accepts them. Stepper never used them, so they went to the root element with the other props.

Stepper now takes both props out before spreading the rest onto the root, so they no longer reach the DOM. The types are unchanged, so code that passes them still compiles. Removing them from the types is a breaking change and can wait for v10.

For reviewers

  • elevation and square are destructured in Stepper.js, so the proptypes script now generates propTypes for them. Adding Stepper to ignoreExternalDocumentation in scripts/generateProptypes.ts marks them @ignore. They stay off the Stepper API page because they have no effect.
  • variant has the same problem. [material-ui] Add own variant overrides to Card, Accordion, AppBar, SnackbarContent, Stepper and TablePagination #49980 fixes it, along with giving Stepper its own variant type.
  • A new test renders <Stepper elevation={3} square> and checks that the <ol> has neither attribute. It failed before the fix, both on the elevation attribute and on the React warning for square.

@siriwatknp siriwatknp added type: bug It doesn't behave as expected. scope: stepper Changes related to the stepper. needs cherry-pick The PR should be cherry-picked to master after merge. v9.x labels Dec 6, 2026
@code-infra-dashboard

code-infra-dashboard Bot commented Dec 6, 2026 •

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-49987--material-ui.netlify.app/
QR code for https://deploy-preview-49987--material-ui.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/material 🔺+21B(0.00%) 🔺+18B(+0.01%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 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

Performance

No regressions in 32 benchmarks · precise to ±3.1% (±6.7% at worst) · ran 1m 59s · details


Check out the code infra dashboard for more information about this PR.

This branch has not been deployed

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

Labels

needs cherry-pick The PR should be cherry-picked to master after merge. scope: stepper Changes related to the stepper. type: bug It doesn't behave as expected. v9.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant