Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SpeedDial] Prevent opening when hovering closed actions #12241

Merged
merged 1 commit into from
Jul 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/material-ui-lab/src/SpeedDial/SpeedDial.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,23 @@ export const styles = {
zIndex: 1050,
display: 'flex',
flexDirection: 'column-reverse', // Place the Actions above the FAB.
pointerEvents: 'none',
},
/* Styles applied to the Button component. */
fab: {
pointerEvents: 'auto',
},
/* Styles applied to the actions (`children` wrapper) element. */
actions: {
display: 'flex',
flexDirection: 'column-reverse', // Display the first action at the bottom.
marginBottom: 16,
paddingBottom: 16,
pointerEvents: 'auto',
},
/* Styles applied to the actions (`children` wrapper) element if `open={false}`. */
actionsClosed: {
transition: 'top 0s linear 0.2s',
pointerEvents: 'none',
},
};

Expand Down Expand Up @@ -171,6 +178,7 @@ class SpeedDial extends React.Component {
ref={ref => {
this.fabRef = ref;
}}
className={classes.fab}
{...ButtonProps}
>
{icon()}
Expand Down
1 change: 1 addition & 0 deletions pages/lab/api/speed-dial.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ This property accepts the following keys:
| Name | Description |
|:-----|:------------|
| <span class="prop-name">root</span> | Styles applied to the root element.
| <span class="prop-name">fab</span> | Styles applied to the Button component.
| <span class="prop-name">actions</span> | Styles applied to the actions (`children` wrapper) element.
| <span class="prop-name">actionsClosed</span> | Styles applied to the actions (`children` wrapper) element if `open={false}`.

Expand Down