Skip to content

Commit e45ece3

Browse files
author
Sean Chamberlain
committed
Allow a tooltip placement prop on SpeedDialAction
1 parent 869692e commit e45ece3

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

packages/material-ui-lab/src/SpeedDialAction/SpeedDialAction.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export interface SpeedDialActionProps
88
ButtonProps?: Partial<ButtonProps>;
99
delay?: number;
1010
icon: React.ReactNode;
11+
tooltipPosition?: string;
1112
tooltipTitle?: React.ReactNode;
1213
}
1314

packages/material-ui-lab/src/SpeedDialAction/SpeedDialAction.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class SpeedDialAction extends React.Component {
5555
onClick,
5656
open,
5757
tooltipTitle,
58+
tooltipPosition,
5859
...other
5960
} = this.props;
6061

@@ -63,7 +64,7 @@ class SpeedDialAction extends React.Component {
6364
id={id}
6465
className={classNames(classes.root, classNameProp)}
6566
title={tooltipTitle}
66-
placement="left"
67+
placement={tooltipPosition}
6768
onClose={this.handleTooltipClose}
6869
onOpen={this.handleTooltipOpen}
6970
open={open && this.state.tooltipOpen}
@@ -124,6 +125,10 @@ SpeedDialAction.propTypes = {
124125
* @ignore
125126
*/
126127
open: PropTypes.bool,
128+
/**
129+
* Placement of the tooltip.
130+
*/
131+
tooltipPosition: PropTypes.string,
127132
/**
128133
* Label to display in the tooltip.
129134
*/
@@ -133,6 +138,7 @@ SpeedDialAction.propTypes = {
133138
SpeedDialAction.defaultProps = {
134139
delay: 0,
135140
open: false,
141+
tooltipPosition: 'left',
136142
};
137143

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

pages/lab/api/speed-dial-action.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ title: SpeedDialAction API
1919
| <span class="prop-name">classes</span> | <span class="prop-type">object |   | Useful to extend the style applied to components. |
2020
| <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. |
2121
| <span class="prop-name required">icon *</span> | <span class="prop-type">node |   | The Icon to display in the SpeedDial Floating Action Button. |
22+
| <span class="prop-name">tooltipPosition</span> | <span class="prop-type">string | <span class="prop-default">'left'</span> | Placement of the tooltip. |
2223
| <span class="prop-name">tooltipTitle</span> | <span class="prop-type">node |   | Label to display in the tooltip. |
2324

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

0 commit comments

Comments
 (0)