preact-css-transition-group icon indicating copy to clipboard operation
preact-css-transition-group copied to clipboard

Doesn't work on Chrome

Open trsh opened this issue 8 years ago • 7 comments

Sorry, but for me this doesn't work at all in Chrome.

When the line

this.timeout = setTimeout(this.flushClassNameQueue, TICK);

is fired and active class is added, the "transitionend" event is fired right away and the translation ends before really starting :(

trsh avatar Jun 20 '17 13:06 trsh

I mean I got the idea, that the class is added after some time (TICK), so Browser starts the transition, but it simply doesn't work that way :/. It happens immediately.

trsh avatar Jun 20 '17 13:06 trsh

Do you have a valid CSS transition defined? If there is an issue with the animation it will fire immediately. Try again with 1.3.0 now that #13 is merged.

developit avatar Jun 20 '17 15:06 developit

@developit ok I will. And report back.

trsh avatar Jun 20 '17 15:06 trsh

@developit it works better, but no good. I created a fiddle to show the 1st problem

https://jsfiddle.net/kvp3dmsa/11/

This is kind of the idea of react transition - a) add initial class (leave/enter), b) then after a tick add active class and the magic should happen. But it doesn't. It only doe's of I move "transition: opacity 2s ease-in;" to .active class. And its same for this module. SOME-HAVE (and it drives me mad) it does's work for React original router.

The second things is, that some-have, after leave and it's active class is removed, there is a small delay before the actual component is removed, and this creates a ugly FLASH glitch :/

trsh avatar Jun 21 '17 09:06 trsh

You need to put transition in .active: https://jsfiddle.net/developit/kvp3dmsa/12/

preview

developit avatar Jun 22 '17 02:06 developit

@developit yes, I wrote that.

"It only doe's of I move "transition: opacity 2s ease-in;" to .active class"

but why then ReactCssGroup and this fork has transition in enter class (https://github.com/developit/preact-css-transition-group/blob/master/tests/style.css). Any why does it work for React and not for this fork :D !??

trsh avatar Jun 22 '17 08:06 trsh

@developit eh ... ended up rolling my own lite custom version (~60 lines of code). Work perfect

trsh avatar Jun 22 '17 10:06 trsh