Skip to content

Commit

Permalink
[materal-ui][SpeedDialAction] Propogate className to SpeedDialActionS…
Browse files Browse the repository at this point in the history
…taticTooltip if tooltipOpenProp is true
  • Loading branch information
sai6855 committed Jan 20, 2025
1 parent bc483df commit 0faf516
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ const SpeedDialAction = React.forwardRef(function SpeedDialAction(inProps, ref)
<SpeedDialActionStaticTooltip
id={id}
ref={ref}
className={classes.staticTooltip}
className={clsx(classes.staticTooltip, className)}
ownerState={ownerState}
{...other}
>
Expand Down
12 changes: 12 additions & 0 deletions packages/mui-material/src/SpeedDialAction/SpeedDialAction.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,16 @@ describe('<SpeedDialAction />', () => {
expect(container.querySelector('button')).to.have.class(classes.fab);
expect(container.querySelector('button')).to.have.class(classes.fabClosed);
});

it('should propagate className to the SpeedDialActionStaticTooltip if tooltipOpen is true', () => {
const { container } = render(
<SpeedDialAction
tooltipOpen
icon={<Icon>add</Icon>}
tooltipTitle="placeholder"
className="foo"
/>,
);
expect(container.querySelector('span')).to.have.class('foo');
});
});

0 comments on commit 0faf516

Please sign in to comment.