Skip to content

[css-transitions] why doesn't transitionend event fire in some cases? #3043

@markcellus

Description

@markcellus

In the spec for transitionend event, it mentions that the transitionend event does not fire

in the case where a transition is removed before completion, such as if the transition-property is removed

I take it that it also does not fire in cases where the element is removed from the DOM, like if set to display:none, etc. Was this decision intentional? why does it not fire in these cases?

I have started a wait-for-element-transition library because current transitionend is not always reliable when you want to just write one set of code for both animated and non-animated set of elements or in the case where whether a set of elements can be animated is unknown. My lib allows a consumer to wait for an element to transition by returning a promise that resolves. The promise will resolve immediately if element is removed from DOM (or if display:none is applied) after the transition has started.

I would rather not have to use a library for this so just wondering if there is a possibility to update the spec to support this use case.

Thanks for your time!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions