Skip to content

Commit 017fcc0

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

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-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);

0 commit comments

Comments
 (0)