Preact: onTransitionEnd stopped working

Created on 31 May 2019  路  4Comments  路  Source: preactjs/preact

Have noticed when aliasing preact 10.beta.1 for an existing react app, when a state change occurred and that variable was passed into a child prop, the child component is removed from the DOM and so transitionEnd events don't trigger.

The React app doesn't use CSSTransition or others libs.

Is this a bug? Or is there something special I need to do?

Most helpful comment

This is an expected change related to the discussion in https://github.com/preactjs/preact/pull/1618 and https://bugs.chromium.org/p/chromium/issues/detail?id=961193.

The short version is that for the moment, you need to use ontransitionend and onanimationend in Preact rather than the capitalised versions. This is due to the way that Preact tests whether an event name exists, but the name needs to be lower-cased.

I wonder whether we ought to paper over this browser difference in preact/compat.

All 4 comments

@cloakedninjas Can you share a codesandbox or a repo where the issue can be reproduced? It helps us tremendously in fixing bugs :+1:

This is an expected change related to the discussion in https://github.com/preactjs/preact/pull/1618 and https://bugs.chromium.org/p/chromium/issues/detail?id=961193.

The short version is that for the moment, you need to use ontransitionend and onanimationend in Preact rather than the capitalised versions. This is due to the way that Preact tests whether an event name exists, but the name needs to be lower-cased.

I wonder whether we ought to paper over this browser difference in preact/compat.

Thanks for update, have been busy so yet to look back into this issue, I'll try and change the casing and report back.

Also 馃憤 for preact/compat to take care of this, saving dependants creating duped attributes

We now smooth over the naming difference in compat :tada:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matthewmueller picture matthewmueller  路  3Comments

skaraman picture skaraman  路  3Comments

jasongerbes picture jasongerbes  路  3Comments

Zashy picture Zashy  路  3Comments

k15a picture k15a  路  3Comments