Skip to content

[SpeedDial] Support action slot object refs - #49056

Open
OskarEichler wants to merge 1 commit into
mui:masterfrom
OskarEichler:codex/mui-speeddial-action-refs
Open

[SpeedDial] Support action slot object refs#49056
OskarEichler wants to merge 1 commit into
mui:masterfrom
OskarEichler:codex/mui-speeddial-action-refs

Conversation

@OskarEichler

Copy link
Copy Markdown

What changed

  • Fixes SpeedDialAction slotProps.fab.ref when it is an object ref such as React.createRef(); the current implementation calls the ref as a function and throws.
  • Preserves cleanup functions returned by React 19 callback refs, allowing React to run the callback's cleanup instead of falling back to a null callback.
  • No public API is removed or renamed. This is a backward-compatible behavior fix.

The wrapper now delegates non-function refs to MUI's existing setRef helper and returns callback-ref cleanup values.

Verification

  • Reproduced the object-ref crash against the unmodified base.
  • Reproduced the missing React 19 callback cleanup against the unmodified base.
  • Verified both cases after the fix.
  • pnpm test:unit run SpeedDial --project 'node:@mui/material'
  • pnpm -F @mui/material typescript
  • Targeted ESLint and Prettier checks.
  • Full pnpm release:build.
  • Full Material Node unit suite: 179 passed / 4 skipped files; 4,712 passed / 759 skipped tests.

The browser test project was not run locally because Playwright Chromium is not installed in this checkout.

Contribution

  • I have followed the contributing guide.

This change and PR description were prepared with OpenAI Codex, then self-reviewed and verified locally. No independent human review has occurred yet.

@code-infra-dashboard

Copy link
Copy Markdown

Deploy preview

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

Bundle size

Bundle Parsed size Gzip size
@mui/material 🔺+36B(+0.01%) 🔺+15B(+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


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

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.

1 participant