From 8306c257258268413e43d3e706a56fe46e3a6b1d Mon Sep 17 00:00:00 2001 From: Weslen do Nascimento Date: Tue, 12 Nov 2019 09:29:10 -0300 Subject: [PATCH] [SpeedDial] Fix crash when using custom style in FabProps (#18320) --- docs/pages/api/speed-dial-action.md | 2 +- .../src/SpeedDialAction/SpeedDialAction.js | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/pages/api/speed-dial-action.md b/docs/pages/api/speed-dial-action.md index f9b5ca5ed4254b..31e1902a2b8e91 100644 --- a/docs/pages/api/speed-dial-action.md +++ b/docs/pages/api/speed-dial-action.md @@ -26,7 +26,7 @@ You can learn more about the difference by [reading this guide](/guides/minimizi |:-----|:-----|:--------|:------------| | classes | object | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. | | delay | number | 0 | Adds a transition delay, to allow a series of SpeedDialActions to be animated. | -| FabProps | object | | Props applied to the [`Fab`](/api/fab/) component. | +| FabProps | object | {} | Props applied to the [`Fab`](/api/fab/) component. | | icon | node | | The Icon to display in the SpeedDial Fab. | | TooltipClasses | object | | Classes applied to the [`Tooltip`](/api/tooltip/) element. | | tooltipOpen | bool | false | Make the tooltip always visible when the SpeedDial is open. | diff --git a/packages/material-ui-lab/src/SpeedDialAction/SpeedDialAction.js b/packages/material-ui-lab/src/SpeedDialAction/SpeedDialAction.js index 545d82adb5d079..af89b88559eac3 100644 --- a/packages/material-ui-lab/src/SpeedDialAction/SpeedDialAction.js +++ b/packages/material-ui-lab/src/SpeedDialAction/SpeedDialAction.js @@ -80,7 +80,7 @@ const SpeedDialAction = React.forwardRef(function SpeedDialAction(props, ref) { classes, className, delay = 0, - FabProps, + FabProps = {}, icon, id, open, @@ -103,19 +103,18 @@ const SpeedDialAction = React.forwardRef(function SpeedDialAction(props, ref) { const transitionStyle = { transitionDelay: `${delay}ms` }; - if (FabProps && FabProps.style) { - FabProps.style.transitionDelay = `${delay}ms`; - } - const fab = ( {icon}