Skip to content

Commit

Permalink
fix(speedDial): Ensure scale animation actions are invisible when clo…
Browse files Browse the repository at this point in the history
…sed.

When using the `scale` animation, the FAB Speed Dial's action items could
sometimes appear as small dots on the screen even when the component was
closed.

This was due to an old bug where closing a dialog from a hidden action
item was throwing an issue. This has since been fixed so we can revert
this back to the original code that used `scale(0)` instead of
`scale(0.1)` which ensured that the dialog always had a button to animate
to when closing.

Also fix an issue with the `ng-hide` animation in the "More Options" demo.

Fixes angular#6344. Fixes angular#6670.
  • Loading branch information
topherfangio committed Jan 20, 2016
1 parent bf78b0c commit cedc8de
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/components/fabSpeedDial/demoMoreOptions/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ md-fab-speed-dial {

// Note: you MUST use an existing CSS class for the animation to fire properly
&.md-scale, &.md-fling {
&.ng-hide {
&.ng-hide-add.ng-hide-add-active {
// Use !important to override ng-hide's `display: none !important`
display: flex !important;
}

&.ng-hide {
md-fab-trigger {
transform: scale(0);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/fabSpeedDial/fabSpeedDial.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
offsetDelay = index * delay;

styles.opacity = ctrl.isOpen ? 1 : 0;
styles.transform = styles.webkitTransform = ctrl.isOpen ? 'scale(1)' : 'scale(0.1)';
styles.transform = styles.webkitTransform = ctrl.isOpen ? 'scale(1)' : 'scale(0)';
styles.transitionDelay = (ctrl.isOpen ? offsetDelay : (items.length - offsetDelay)) + 'ms';

// Make the items closest to the trigger have the highest z-index
Expand Down
2 changes: 1 addition & 1 deletion src/components/fabSpeedDial/fabSpeedDial.scss
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ md-fab-speed-dial {

&.md-scale {
.md-fab-action-item {
transform: scale(0.1);
transform: scale(0);
transition: $swift-ease-in;

// Make the scale animation a bit faster since we are delaying each item
Expand Down

0 comments on commit cedc8de

Please sign in to comment.