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][SpeedDialAction] Add slots and slotProps #45065

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

sai6855
Copy link
Contributor

@sai6855 sai6855 commented Jan 20, 2025

part of #41281

This PR adds fab, tooltip, staticTooltip, staticTooltipLabel slots, I'll deprecate tooltip* props in seperate PR

@sai6855 sai6855 changed the title Spped-dial-slots [material-ui][SpeedDialAction] Add slots and slotProps Jan 20, 2025
@sai6855 sai6855 added component: speed dial This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material labels Jan 20, 2025
@mui-bot
Copy link

mui-bot commented Jan 20, 2025

Netlify deploy preview

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

@material-ui/core: parsed: +0.09% , gzip: +0.07%
SpeedDialAction: parsed: +0.36% , gzip: +0.24%
@material-ui/lab: parsed: +0.17% , gzip: +0.12%

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 4cbcab1

@sai6855

This comment was marked as outdated.

@sai6855 sai6855 requested a review from siriwatknp January 20, 2025 11:55
@sai6855
Copy link
Contributor Author

sai6855 commented Jan 21, 2025

@siriwatknp PR is ready for review

shouldForwardComponentProp: true,
className: clsx(classes.fab, className),
additionalProps: {
style: {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
style: {
style: transitionStyle

No need to spread the FabProps.style, the slotProps.fab.style (from FabProps) will be merged by useSlot.

Comment on lines +212 to +213
onClose: handleTooltipClose,
onOpen: handleTooltipOpen,
Copy link
Member

Choose a reason for hiding this comment

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

These should goes into getSlotProps, so that slotProps.tooltip.onOpen does not replace the handleTooltipClose.

    elementType: Tooltip,
    externalForwardedProps,
    shouldForwardComponentProp: true,
    ref,
    getSlotProps: (handlers) => ({
      onClose: () => {
        handlers.onClose?.(),
        handleTooltipClose(),
      },
      onOpen: 
    })

expectedClassName: classes.fab,
testWithElement: null,
testWithComponent: CustomButton,
},
Copy link
Member

@siriwatknp siriwatknp Jan 23, 2025

Choose a reason for hiding this comment

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

Other slots are missing.

@siriwatknp
Copy link
Member

I'll deprecate tooltip* props in seperate PR

If you don't mind, can you do it directly in this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: speed dial This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants