I am adding an animation to my ion-item as it is added to the list. It works but the animation transition is not smooth as it should be. If I use the animation on a normal div (using background-color) it works as expected with the color slowly fading from blue to white. However when using --background which you have to for ion-item it stays blue until the end then jumps to white.
Any suggestions on how to get this transitioning smoothly?
I am using Ionic 5
Edit: Also on iOS the color change is ignored completely. Just the opacity is changed.
@keyframes highlight-add {
0% {
--background: #a8d8ea;
opacity: 0.3;
}
30% {
--background: #a8d8ea;
opacity: 1;
}
100% {
--background: #fff;
}
}
.student-item-animate {
-webkit-animation: highlight-add 5s;
animation: highlight-add 5s;
}
<ion-item *ngFor="let student of studentsBooked" [ngClass]="{'student-item-animate': student.isNew}">
See my stackoverflow here: https://stackoverflow.com/questions/60679644/keyframe-animation-on-ion-item-is-not-transitioning-smoothly