aurelia / aurelia/animator-css

Update before animation if interpolation in element class

Open
#48 11 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
44
Forks
25
PR merge metrics
No merged PRs in 30d

Description

I'm following [this guide](http://blog.durandal.io/2015/07/17/animating-apps-with-aurelia-part-1/) and expected to see something like:

![expected behaviour](http://blog.durandal.io/content/images/2015/07/list-staggered-animate.gif)

Instead I got:

![actual behaviour](http://i.imgur.com/ZnoYGY0.gif)

Not sure what I'm doing wrong: my code is essentially the same as in the guide.

``` html

```

``` ts
export class FeedbackService {

private static REMOVE_DELAY_MS = 5000;

public items: FeedbackItem[] = [];

addItem(item: FeedbackItem) {
this.items.push(item);
if (item.autohide) {
setTimeout(
() => this.removeItem(item),
FeedbackService.REMOVE_DELAY_MS * this.items.filter((item) => item.autohide).length
);
}
}

removeItem(item: FeedbackItem) {
let index = this.items.indexOf(item);
if (index > -1) {
this.items.splice(index, 1);
}
}
}
```

``` scss
.feedback-item {
&.au-enter {
max-height: 0;
}
&.au-enter-active {
animation: feedbackUp 1s;
}
&.au-leave-active {
animation: feedbackDown 1s;
}
}

@keyframes feedbackUp {
0% { max-height: 0; }
100% { max-height: 102px; }
}

@keyframes feedbackDown {
0% { max-height: 102px; }
100% { max-height: 0; }
}
```

Contributor guide

Open the contributing guide

Research direction

Start from the supplied template, FeedbackService reproduction, and SCSS animation rules, then compare the actual and expected animation behavior from the linked guide. Trace how repeated elements receive animation classes during insertion and removal, and use the provided example to verify that interpolation and the animation timing produce the expected staggered result.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.