Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(speedDial): Fix intially open bug.
Browse files Browse the repository at this point in the history
Due to an animation issue, the FAB Speed Dial started in an open
state when using the `md-fling` animation.

Fix by delaying the initial animation until after the component
was fully rendered so that the animation's calculations were correct
and adding some CSS to ensure the first animation fired instantly.

Fixes #6111.
  • Loading branch information
topherfangio committed Dec 9, 2015
1 parent 2ab3075 commit 538b87e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/fabSpeedDial/fabController.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,13 @@

// Fire the animations once in a separate digest loop to initialize them
function fireInitialAnimations() {
$mdUtil.nextTick(function() {
$animate.addClass($element, 'md-noop');
});
var delay = 100; // Delay until after the element has been appened to the DOM

$timeout(function() {
$animate.addClass($element, 'md-noop').then(function() {
$element.removeClass('md-noop');
});
}, delay);
}

function enableKeyboard() {
Expand Down
7 changes: 7 additions & 0 deletions src/components/fabSpeedDial/fabSpeedDial.scss
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ md-fab-speed-dial {
/*
* Handle the animations
*/
&.md-fling.md-noop {
// For the intial animation, set the duration to be instant
.md-fab-action-item {
transition-duration: 0s;
}
}

&.md-scale {
.md-fab-action-item {
opacity: 0;
Expand Down

0 comments on commit 538b87e

Please sign in to comment.