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 e45ece3
Show file tree
Hide file tree
Showing 3 changed files with 9 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);
1 change: 1 addition & 0 deletions pages/lab/api/speed-dial-action.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ title: SpeedDialAction API
| <span class="prop-name">classes</span> | <span class="prop-type">object |   | Useful to extend the style applied to components. |
| <span class="prop-name">delay</span> | <span class="prop-type">number | <span class="prop-default">0</span> | Adds a transition delay, to allow a series of SpeedDialActions to be animated. |
| <span class="prop-name required">icon *</span> | <span class="prop-type">node |   | The Icon to display in the SpeedDial Floating Action Button. |
| <span class="prop-name">tooltipPosition</span> | <span class="prop-type">string | <span class="prop-default">'left'</span> | Placement of the tooltip. |
| <span class="prop-name">tooltipTitle</span> | <span class="prop-type">node |   | Label to display in the tooltip. |

Any other properties supplied will be spread to the root element (native element).
Expand Down

0 comments on commit e45ece3

Please sign in to comment.