Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix($animateCss): ensure animations execute if only a keyframeStyle is provided #12340

Closed
wants to merge 2 commits into from

Conversation

matsko
Copy link
Contributor

@matsko matsko commented Jul 14, 2015

$animateCss is a fan of transition animations, but it turns out that
if only a keyframeStyle is provided into the animation upon constrution
then it will quit because it assumes that nothing will be animated
(since no classes or styles are being applied). This patch ensures that
a keyframe style can solely be applied to an animation triggered with
$animateCss.

// this will now work as expected
$animateCss(element, { keyframeStyle: '1s rotate' }).start();

Closes #12124

…s provided

`$animateCss` is a fan of transition animations, but it turns out that
if only a keyframeStyle is provided into the animation upon constrution
then it will quit because it assumes that nothing will be animated
(since no classes or styles are being applied). This patch ensures that
a keyframe style can solely be applied to an animation triggered with
`$animateCss`.

```js
// this will now work as expected
$animateCss(element, { keyframeStyle: '1s rotate' }).start();
```

Closes angular#12124
Closes angular#12340
@matsko matsko force-pushed the fix_keyframe_styles_bug branch from b54eefd to a0569b2 Compare July 14, 2015 00:41
…igger anything

Using `transitionStyle` without any other properties does not trigger an
animation so we could have a test to assert that it doesn't do that.

// there is no way we can trigger an animation since no styles and
// no classes are being applied which would then trigger a transition
if (!hasToStyles && !setupClasses) {
// is there a raw keyframe value that is applied to the element
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment seems a bit weird in the context of the previous two lines...

Perhaps these three comment lines should read:

// there is no way we can trigger an animation if no styles and
// no classes are being applied which would then trigger a transition,
// unless there a is raw keyframe value that is applied to the element

@matsko matsko closed this in 97d79ee Jul 14, 2015
netman92 pushed a commit to netman92/angular.js that referenced this pull request Aug 8, 2015
…s provided

`$animateCss` is a fan of transition animations, but it turns out that
if only a keyframeStyle is provided into the animation upon constrution
then it will quit because it assumes that nothing will be animated
(since no classes or styles are being applied). This patch ensures that
a keyframe style can solely be applied to an animation triggered with
`$animateCss`.

```js
// this will now work as expected
$animateCss(element, { keyframeStyle: '1s rotate' }).start();
```

Closes angular#12124
Closes angular#12340
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants