Skip to content

Commit

Permalink
fix: avoid triggering multiple animationend events
Browse files Browse the repository at this point in the history
To prevent the triggering of multiple `animationend` events, a fix has been implemented for combined
animations such as: `fade-in-grow`, `fade-out-shrink` and `slide-up-fade-in`.

Previously, an `animationend` event would be triggered for each individual animation, leading to
unexpected behavior. This fix introduces an `infinite` iteration count in one of the animations,
ensuring that only a single `animationend` event is triggered.
  • Loading branch information
jboix committed Feb 29, 2024
1 parent efb987b commit a791308
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/theme/animations.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,17 @@
.slide-up-fade-in {
opacity: 0;
animation: fade-in .4s var(--ease-elastic-in-3) forwards,
slide-in-up .4s var(--ease-elastic-in-3);
slide-in-up .4s var(--ease-elastic-in-3) infinite;
}

.fade-in-grow {
opacity: 0;
animation: fade-in .4s var(--ease-elastic-in-3) forwards,
grow .4s ease;
animation: fade-in .4s var(--ease-elastic-in-3) forwards, grow .4s ease infinite;
}

.fade-out-shrink {
opacity: 0;
animation: fade-in .4s var(--ease-elastic-in-3) forwards, grow .4s ease;
animation: fade-in .4s var(--ease-elastic-in-3) forwards, grow .4s ease infinite;
animation-direction: reverse;
}

Expand Down

0 comments on commit a791308

Please sign in to comment.