Smooth animation onClick button

Try first to hide the image inside the box, then hide the box itself.
I also have had once such issues with showing and hiding animations.
You will have to be tricky to find the right way of how to manage it.
Yes, i know - → Wix could make it a little bit better, but it is like it is.

Both shown code-examples did help me in some situations.
My las approach would be to try it with . - → setTimeOut(()=>{ }, 1000 );

1000 = milliseconds