-
-
Notifications
You must be signed in to change notification settings - Fork 79k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed issue with multiple CSS transitions #13286
Conversation
Fixed an issue with the transitions of the carousel, which failed when more than one CSS transition was set, due to multiple durations being return. (E.g. ".6s, 2s".)
@tdolsen thanks for the pr i think if we want to go this route (which seems reasonable), this should be applied across all plugins that use why |
@cvrebert it's ok, that's my bad… I was pretty absent. I think the idea is good, just want to see it propagated across the other plugins in a consistent way 👍 |
My bad yo—I don't even recall merging that O_O. |
Competing pull request: #13602 |
Hey guys, I discovered something important that you guys should know after I closed #13602, it pertains to how this pull request effects the flow of emulateTransitionEnd()
the event transitionend will fire twice, once for height, once for width. They way that you have
will not work properly with multiple transitions when those transitions have different durations. the callback will always fire on the shortest one, and 'called' in emulateTransitionEnd will be set on that first transitionEnd as well. In your current implementation of this, this pull-request is mute (sorry @tdolsen) the way I found around this is:
and of course emulateTransitionEnd would have to be adjusted as well, the manual trigger would have to be
and you'd have to do the same .one to .on w/ .off inside the call back I hope that helps. If I get the time I'll apply this to #13602 and re-open. |
I'm kinda thinking that transition duration should be constants set on the constructor. This way we dont have to rely on trying to parse css rules, and in the rare case that someone wants to much with the transition defaults we set in our lib in the css, they have a clear path to updating the values in the js too |
given that, i'm going to close this issue for now in favor of this issue: #13656 |
Fixed an issue with the transitions of the carousel, which failed to apply the
next
,prev
,left
andright
classes when more than one CSS transition was set. This was due to multiple durations being returned as a comma-separated list (e.g.".6s, 2s"
) whichslice(0, 1) * 1000
would turn into aNaN
.The fix adds another function,
findDuration
, to theemulateTransitionEnd
flow, which returns the highest duration in the comma-separated list as milliseconds. The function won't interfere with existing uses, as integers are ignored.