Skip to content

Commit 09ff695

Browse files
committed
Add option to run enter and leave animations in parallel
1 parent 06d1ad5 commit 09ff695

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/components/animated-outlet.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ export class AnimationHook {
1111
return outlet.hasAttribute(name) || this.options[name]
1212
}
1313

14+
runParallel (outlet) {
15+
return this.hasOption(outlet, 'parallel')
16+
}
17+
1418
beforeAdd (outlet, el) {
1519

1620
}
@@ -212,10 +216,11 @@ export class AnimatedOutlet extends HTMLElement {
212216
return
213217
}
214218
const hook = getAnimationHook(this.getAttribute('animation'))
219+
const runParallel = hook.runParallel(this)
215220

216221
hook.beforeAdd(this, el)
217222
super.appendChild(el)
218-
if (this.removing) {
223+
if (!runParallel && this.removing) {
219224
// when removing a previous el, append animation is run after remove one
220225
this.appending = el
221226
} else {

0 commit comments

Comments
 (0)