Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[material-ui] mergeSlotProps doesn't handle functions #45503

Open
DiegoAndai opened this issue Mar 6, 2025 · 3 comments · May be fixed by #45543
Open

[material-ui] mergeSlotProps doesn't handle functions #45503

DiegoAndai opened this issue Mar 6, 2025 · 3 comments · May be fixed by #45543
Assignees
Labels
bug 🐛 Something doesn't work customization: logic Logic customizability package: material-ui Specific to @mui/material

Comments

@DiegoAndai
Copy link
Member

DiegoAndai commented Mar 6, 2025

Steps to reproduce

Steps:

  1. Open this link to live example: https://stackblitz.com/edit/stackblitz-starters-gh8zdjcb?file=src%2FApp.tsx
  2. Click the button
  3. See how only one of the functions is called

Current behavior

Only one of the functions is called

Expected behavior

Both of the functions should be called

Context

Discovered in #45210 (comment)

Your environment

npx @mui/envinfo
  System:
    OS: macOS 14.5
  Binaries:
    Node: 22.2.0 - ~/.nvm/versions/node/v22.2.0/bin/node
    npm: 10.7.0 - ~/.nvm/versions/node/v22.2.0/bin/npm
    pnpm: 9.15.4 - ~/.nvm/versions/node/v22.2.0/bin/pnpm
  Browsers:
    Chrome: 134.0.6998.44
    Edge: 133.0.3065.92
    Safari: 17.5
  npmPackages:
    @mui/internal-docs-utils: workspace:^ => 2.0.0 
    @mui/internal-scripts: workspace:^ => 2.0.3 
    @mui/internal-test-utils: workspace:^ => 2.0.3 
    @mui/joy: workspace:* => 5.0.0-beta.49 
    @mui/material: workspace:^ => 7.0.0-beta.2 
    @mui/utils: workspace:^ => 7.0.0-beta.2 
    @pigment-css/react: 0.0.30 => 0.0.30 
    @types/react: ^19.0.10 => 19.0.10 
    typescript: ^5.7.3 => 5.7.3 

Search keywords: mergeSlotProps functions slotprops slots

@siriwatknp

This comment has been minimized.

@mnajdova
Copy link
Member

In a generic function like this, wouldn't it make sense to compose the event handlers and make the other functions replace the existing ones? Btw, there is similar utility in Base UI, maybe we can take the logic from there?

@siriwatknp
Copy link
Member

In a generic function like this, wouldn't it make sense to compose the event handlers and make the other functions replace the existing ones? Btw, there is similar utility in Base UI, maybe we can take the logic from there?

True, make sense to follow Base UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work customization: logic Logic customizability package: material-ui Specific to @mui/material
Projects
Status: In progress
Development

Successfully merging a pull request may close this issue.

3 participants