Skip to content
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

Promise of zero duration tween is not resolved #590

Open
benwick opened this issue Aug 26, 2024 · 4 comments
Open

Promise of zero duration tween is not resolved #590

benwick opened this issue Aug 26, 2024 · 4 comments

Comments

@benwick
Copy link

benwick commented Aug 26, 2024

Well, it is all in the title. Every tween has a then method to wait for a promise. If the tween has a duration of zero the promise is not resolved. That can't be right, can it?

Here is a quick pen: https://codepen.io/benwick83/pen/OJeEmmV

  • newest version
  • alert is not shown
  • change the duration to something other than zero, alert will pop up
@jey-exp
Copy link

jey-exp commented Oct 20, 2024

Where do you use this? Can figure out any other way around.

@minwork
Copy link

minwork commented Oct 21, 2024

I've also encountered that case. Imagine you have a variable holding animation duration, if the animation should be instant you just set the duration to 0. Of course you could always make an if and return regular Promise.resolve() in that case but that is counter-intuitive and unnecessary complicates the API call.

@jey-exp
Copy link

jey-exp commented Oct 23, 2024

okay, Will setting the duration to 0.1 and ease to none will solve this?

@minwork
Copy link

minwork commented Oct 29, 2024

It would be just another workaround and not optimal one. To clearly illustrate the case here is the exact code and workaround needed for the current behaviour.

Screenshot 2024-10-29 at 17 44 59

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

No branches or pull requests

3 participants