Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,20 @@ export function setElementAnimation(
) {
const { animationName, duration, delay, easing } = animationConfig;

element.style.animationName = animationName;
element.style.animationDuration = `${duration}s`;
element.style.animationDelay = `${delay}s`;
element.style.animationTimingFunction = easing;
const configureAnimation = () => {
element.style.animationName = animationName;
element.style.animationDuration = `${duration}s`;
element.style.animationDelay = `${delay}s`;
element.style.animationTimingFunction = easing;
};

if (animationConfig.animationType === LayoutAnimationType.ENTERING) {
// On chrome sometimes entering animations flicker. This is most likely caused by animation being interrupted
// by already started tasks. To avoid flickering, we use `requestAnimationFrame`, which will run callback right before repaint.
requestAnimationFrame(configureAnimation);
} else {
configureAnimation();
}

element.onanimationend = () => {
if (shouldSavePosition) {
Expand Down