Skip to content

Commit

Permalink
Fix #4305: SpeedDialog buttonTemplate restored (#4307)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored May 3, 2023
1 parent c7147f1 commit 1304fd5
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions components/lib/speeddial/SpeedDial.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as React from 'react';
import { Button } from '../button/Button';
import { useEventListener, useMountEffect, useUpdateEffect } from '../hooks/Hooks';
import { MinusIcon } from '../icons/minus';
import { PlusIcon } from '../icons/plus';
import { Ripple } from '../ripple/Ripple';
import { classNames, DomHandler, IconUtils, ObjectUtils } from '../utils/Utils';
import { DomHandler, IconUtils, ObjectUtils, classNames } from '../utils/Utils';
import { SpeedDialBase } from './SpeedDialBase';
import { PlusIcon } from '../icons/plus';
import { MinusIcon } from '../icons/minus';

export const SpeedDial = React.memo(
React.forwardRef((inProps, ref) => {
Expand Down Expand Up @@ -225,6 +225,19 @@ export const SpeedDial = React.memo(
const toggleIcon = IconUtils.getJSXIcon(icon, { className: iconClassName }, { props, visible });
const content = <Button type="button" style={props.buttonStyle} className={className} icon={toggleIcon} onClick={onClick} disabled={props.disabled} aria-label={props['aria-label']} />;

if (props.buttonTemplate) {
const defaultContentOptions = {
onClick,
className,
iconClassName,
element: content,
props,
visible
};

return ObjectUtils.getJSXElement(props.buttonTemplate, defaultContentOptions);
}

return content;
};

Expand Down

0 comments on commit 1304fd5

Please sign in to comment.