Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

bug: ReactTransitionEvents doesn't work in supported browsers #396

Open
Hotell opened this issue Jun 7, 2017 · 6 comments
Open

bug: ReactTransitionEvents doesn't work in supported browsers #396

Hotell opened this issue Jun 7, 2017 · 6 comments

Comments

@Hotell
Copy link

Hotell commented Jun 7, 2017

I'm submitting a ... (check one with "x")

[x] bug report
[ ] feature request

Current behavior

Issue is that you are registering TransitionEnd / AnimationEnd in browsers that support ontransitionend/onanimationend -> this leads that not existent event is registered in supported browsers and things don't work.

Expected/New behavior

register proper events cross-browser

Minimal reproduction of the problem with instructions

For instance react-redux-toaster is using ReactTransitionEvents for registering transition events.

With React works without issues

preact-compat-issue-with-events-react

With Preact, the proper events are not called so it is not removed from store and stays in DOM

What is the motivation / use cases?
Some react libs are using ReactTransitionEvents for critical functionality ( like cleaning up store )

Preact-compat version: 3.16.0

Browser:
Chrome, FF, Edge, Safari

I can send PR if you're ok with that

Thanks

@thomas-p-wilson
Copy link

Am having the exact same issue here, also with react-redux-toastr in fact.

@developit
Copy link
Member

Perhaps we can use the implementation from css transition group?
https://github.com/developit/preact-css-transition-group/blob/master/src/TransitionEvents.js#L74

@thomas-p-wilson
Copy link

thomas-p-wilson commented Jun 10, 2017 via email

@thomas-p-wilson
Copy link

thomas-p-wilson commented Jun 10, 2017 via email

@thomas-p-wilson
Copy link

thomas-p-wilson commented Jun 10, 2017 via email

@deepkolos
Copy link

deepkolos commented Nov 12, 2019

have the same issue

图片

the first one is created by preact , won't trigger when transitionend
the second is created by addEventlistener, will trigger when transitionend

i use ontransitionend as workround...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants