Skip to content

Commit

Permalink
Merge 4014862 into 7702509
Browse files Browse the repository at this point in the history
  • Loading branch information
jhsware committed Oct 25, 2021
2 parents 7702509 + 4014862 commit fc22a87
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/animations-demo-inner/dist/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 10 additions & 6 deletions packages/inferno-animation/src/animationCoordinator.ts
Expand Up @@ -53,16 +53,18 @@ function _runAnimationPhases() {
switch (phase) {
case AnimationPhase.ACTIVATE_ANIMATION:
// Final phase - Activate animations
// This is a special case and is executed differently from others
_animationActivationQueue = _animationActivationQueue.concat(animationQueue);
if (_nextActivateAnimationFrame === IDLE) {
// Animations are activated on the next animation frame
_nextActivateAnimationFrame = requestAnimationFrame(_runActivateAnimationPhase);
}
break;
case AnimationPhase.ACTIVATE_TRANSITIONS:
// Force reflow before executing ACTIVATE_TRANSITIONS
forceReflow();
default:
if (phase === AnimationPhase.ACTIVATE_TRANSITIONS) {
// Force reflow before executing ACTIVATE_TRANSITIONS
forceReflow();
}
for (let j = 0; j < animationQueue.length; j++) {
animationQueue[j](phase);
}
Expand All @@ -80,16 +82,18 @@ function _debugAnimationPhases(phase: AnimationPhase, animationQueue) {
switch (phase) {
case AnimationPhase.ACTIVATE_ANIMATION:
// Final phase - Activate animations
// This is a special case and is executed differently from others
_animationActivationQueue = _animationActivationQueue.concat(animationQueue);
if (_nextActivateAnimationFrame === IDLE) {
// Animations are activated on the next animation frame
_nextActivateAnimationFrame = requestAnimationFrame(_runActivateAnimationPhase);
}
break;
case AnimationPhase.ACTIVATE_TRANSITIONS:
// Force reflow before executing ACTIVATE_TRANSITIONS
forceReflow();
default:
if (phase === AnimationPhase.ACTIVATE_TRANSITIONS) {
// Force reflow before executing ACTIVATE_TRANSITIONS
forceReflow();
}
for (let j = 0; j < animationQueue.length; j++) {
animationQueue[j](phase);
}
Expand Down
4 changes: 4 additions & 0 deletions packages/inferno-animation/src/animations.ts
Expand Up @@ -96,6 +96,7 @@ function _didAppear(phase: AnimationPhase, dom: HTMLElement, cls: AnimationClass
[dom],
_getDidAppearTransitionCallback(dom, cls)
);
return;
case AnimationPhase.ACTIVATE_ANIMATION:
// 4. Activate target state (called async via requestAnimationFrame)
setDimensions(dom, dimensions.width, dimensions.height);
Expand Down Expand Up @@ -133,11 +134,13 @@ function _willDisappear(phase: AnimationPhase, dom: HTMLElement, callback: Funct
[dom],
callback
);
return;
case AnimationPhase.ACTIVATE_ANIMATION:
// 4. Activate target state (called async via requestAnimationFrame)
addClassName(dom, cls.end);
removeClassName(dom, cls.start);
clearDimensions(dom);
return;
}
}

Expand Down Expand Up @@ -254,6 +257,7 @@ function _willMove(phase: AnimationPhase, cls: AnimationClass, animState) {
}
// TODO: Set dimensions
if (parentVNode.$MV) parentVNode.$MV = false;
return;
}
}

Expand Down

0 comments on commit fc22a87

Please sign in to comment.