[SpeedDial] Support action slot object refs by OskarEichler · Pull Request #49056 · mui/material-ui · GitHub
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
Contributor

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

code-infra-dashboard Bot commented Aug 29, 2026

Copy link
Copy Markdown

@zannager zannager added the scope: speed dial Changes related to the speed dial. label Aug 31, 2026
@zannager
zannager requested a review from sai6855 August 31, 2026 14:06

@sai6855 sai6855 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Changes looks good, can you add a test?

Let me know if you need any help writing a test

@sai6855 sai6855 added the type: bug It doesn't behave as expected. label Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

@OskarEichler
OskarEichler force-pushed the codex/mui-speeddial-action-refs branch from 277f748 to 0cfff2e Compare September 4, 2026 16:21
@OskarEichler
OskarEichler force-pushed the codex/mui-speeddial-action-refs branch from 0cfff2e to a013f55 Compare September 4, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: speed dial Changes related to the speed dial. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants