This repository was archived by the owner on Dec 13, 2023. It is now read-only.
  
  
  
  
  
Description
Imagine you have a button which toggles transition on click, something like this:
<Transition>
  <div id='animated-container'> // This has animation of 300ms
      <button /> // This button has background transition of 100ms on hover
    </div>
<Transition> 
Since button transition finishes first these listeners inside cssExit will catch it and remove element from DOM despite the fact that main animation is still running.
  
  
    
        
           | 
           el.addEventListener('transitionend', removeEls, { once: true });  | 
        
        
           | 
           el.addEventListener('animationend', removeEls, { once: true });  | 
        
    
   
 
A solution for that is to check if event target is the container and not one of the children.