Andrew Hudson @andrewhudson.dev · Sep 26

@bram.us is it possible to know if a transition is "transitioning" in CSS? i.e. I am transitioning a popover but if I try and re-open the popover while it is closing it reverses the transition. To prevent the button from firing if the popover is transitioning. codepen.io/bigandy/pen/...

0 likes 1 replies

?

Replies

Bramus · Sep 26

You can‘t in CSS but can in JS by filtering out the transitions: $dialog.getAnimations().filter(a => a instanceof CSSTransition) I think you could maybe hack something together with transitions + style queries + pointer-events, but that seems convoluted (+ doesn’t prevent keyboard interaction)