When I attach a transitionend event listener to element
using the code below, everything works smoothly:
element.addEventListener('transitionend', transitionEnd);
function transitionEnd() {
console.log('transitionEnd fired');
}
However, there is one issue: if I lose focus on the page (such as by opening another tab or window), the event does not trigger!!!
Why is this happening and what can be done to resolve it?