Skip to content

Commit

Permalink
Allow a tooltip placement prop on SpeedDialAction
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Chamberlain committed Jul 23, 2018
1 parent 869692e commit 017fcc0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface SpeedDialActionProps
ButtonProps?: Partial<ButtonProps>;
delay?: number;
icon: React.ReactNode;
tooltipPosition?: string;
tooltipTitle?: React.ReactNode;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class SpeedDialAction extends React.Component {
onClick,
open,
tooltipTitle,
tooltipPosition,
...other
} = this.props;

Expand All @@ -63,7 +64,7 @@ class SpeedDialAction extends React.Component {
id={id}
className={classNames(classes.root, classNameProp)}
title={tooltipTitle}
placement="left"
placement={tooltipPosition}
onClose={this.handleTooltipClose}
onOpen={this.handleTooltipOpen}
open={open && this.state.tooltipOpen}
Expand Down Expand Up @@ -124,6 +125,10 @@ SpeedDialAction.propTypes = {
* @ignore
*/
open: PropTypes.bool,
/**
* Placement of the tooltip.
*/
tooltipPosition: PropTypes.string,
/**
* Label to display in the tooltip.
*/
Expand All @@ -133,6 +138,7 @@ SpeedDialAction.propTypes = {
SpeedDialAction.defaultProps = {
delay: 0,
open: false,
tooltipPosition: 'left',
};

export default withStyles(styles, { name: 'MuiSpeedDialAction' })(SpeedDialAction);

0 comments on commit 017fcc0

Please sign in to comment.