-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Comments
Where do you use this? Can figure out any other way around. |
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 |
okay, Will setting the duration to 0.1 and ease to none will solve this? |
Great catch. That should be resolved in the next release. Sorry about the delay/inconvenience. |
- IMPROVED: if you set immediateRender: true on a motionPath tween, it'll force the initial render to put that element on the path right away. - IMPROVED: ScrollTrigger.sort() uses a better default algorithm that prioritizes the vertical position of the trigger element instead of the calculated start position of the ScrollTrigger. See https://gsap.com/community/forums/topic/40584-scrolltriggerrefresh-doesnt-do-anything-after-pinned-sections-are-dynamically-loaded/ - IMPROVED: TypeScript definition for MotionPathPlugin, like for allowing strings in the Array-based syntax, like [{x: "100vw"}] and function-based values for start/end. See https://gsap.com/community/forums/topic/40894-typescript-errors-for-start-and-end-fields-for-motionpath/ and #578 - IMPROVED: you can pass true to ScrollTrigger.refresh(true) to have it do a "safe" refresh, meaning that if the page is in the middle of scrolling, it'll wait until it's done before doing the refresh. That way, it won't kill an in-progress momentum scroll. See https://gsap.com/community/forums/topic/40935-gsap-scrolltrigger-start-position-breaks-on-dom-changes/ - IMPROVED: added pointer-events: none to pin spacer elements that ScrollTrigger creates which helps work around a Chrome browser bug. - IMPROVED: Expo ease was enhanced to eliminate the possible jump at the very end. See https://gsap.com/community/forums/topic/25331-weird-jump-at-end-of-tween-with-expoout-ease/ - FIXED: if you set a zIndex on a Flip.fit(), it works now. - FIXED: reading transform-related properties on a position: fixed element that has no transforms applied could result in the element getting temporarily added to the DOM at the root which could cause iframe content to reload, like a Vimeo video. See https://gsap.com/community/forums/topic/39645-flip-with-iframe-causes-iframe-to-rerender/ - FIXED: repeatRefresh may not actually refresh in a very rare condition (regression in 3.12.3). - FIXED: if you use special characters like >,<, &, etc. in a TextPlugin tween on an SVG element, those characters could get replaced with the HTML code (like > for >). See https://gsap.com/community/forums/topic/35550-handwritng-and-typewriter-animation-on-path-in-svg/ - FIXED: if you gsap.registerPlugin(ScrollTrigger) in an SSR framework like Next.js, it could complain that a style attribute was added to the document.body. That's removed now. - FIXED: if you set a non-zero stagger value in gsap.defaults() (which is a very strange thing to do), it could throw an error when creating a gsap.quickTo(). - FIXED: repeatRefresh is in the TypeScript definitions now for staggers. See #595 - FIXED: on a motionPath tween, if you use an Array-based path with targets that have a "style" property but are NOT DOM nodes, and the properties have names that are transform-related like x, y, scaleX, scaleY, etc., it could throw errors. See https://gsap.com/community/forums/topic/40023-motionpath-plugin-problem/ - FIXED: if you navigate back to a page that then reuses the same ScrollTrigger instance (like a React routing change), a timeline that has a scrubbed ScrollTrigger may not render the playhead at the right in-progress spot. See https://gsap.com/community/forums/topic/39982-scrolltrigger-breaks-when-navigating-back-usegsap-react-react-router/ - FIXED: on an Observer, if you set passive: false that may be ignored unless preventDefault is true. This is fixed now. - FIXED: ScrollTriggers with a containerAnimation may not refresh their start/end values correctly if ScrollSmoother is used or ScrollTrigger.sort() is called. See https://gsap.com/community/forums/topic/37419-horizontal-scroll-resize/ - FIXED: on a tween with repeatRefresh: true, it may skip the refreshing of values if the parent playhead lands beyond where the repeat spot is, but by less than 0.000001 seconds (exceedingly rare!). - FIXED: if you do a .from() animation of borderRadius using a unit of "rem", it may jump a bit at the very end of the tween. See https://gsap.com/community/forums/topic/40096-scroll-trigger-auto-scroll-back-and-animation-over-shoot/ - FIXED: if you revert() a gsap.context() that has a ScrollTrigger with a scroller that's not the window, it could cause snapping to no longer function. This affects the @gsap/react package's useGSAP() hook too. See https://gsap.com/community/forums/topic/40198-snapping-breaks-when-re-rendering-in-react/ - FIXED: if you set once: true on the first ScrollTrigger (in terms of refreshPriority order) and it activates on page load (meaning its start is smaller than the page's current scroll position), it could throw an error. See https://gsap.com/community/forums/topic/40242-scrolltriggerbatch-bug-with-once-scrolltriggers/ - FIXED: if you set a minimumMovement on a Draggable of type: "rotation", it would interpret it in degrees rather than pixels, and a minimumMovement of 0 would actually default to 2 (degrees). - FIXED: worked around an odd behavior in Firefox where the browser would fire pointermove events without the pointer moving at all which affected Observer's lockAxis behavior and it could prematurely fire an onDrag, etc. - FIXED: if you kill() a completed tween that has a ScrollTrigger, it may not also kill the ScrollTrigger. See https://gsap.com/community/forums/topic/40359-gsap-kill-doesnt-stop-scrolltrigger-onupdate-from-running/ - FIXED: extremely rare edge case where a lazy-initted tween is initially set to render at a non-zero time but before that lazy tween renders lazily, a render is triggered at a time of 0, it could end up rendering at the wrong time (the lazy-initted one instead of the slightly later render). - FIXED: orientation changes didn't properly trigger a ScrollTrigger.refresh(), so the start/end values of ScrollTriggers could be inaccurate after an orientation change. See https://gsap.com/community/forums/topic/40713-scrolltriggers-are-positioned-wrong-after-orientation-change/ - FIXED: an Observer may fire an onDrag() AFTER the onDragEnd() if debounce is true, but now it'll make sure it fires it BEFORE the onDragEnd(). Also, with debounce: false, an onDrag() could fire before the onDragStart(). See https://gsap.com/community/forums/topic/40909-observer-ondrag-firing-after-ondragend/ - FIXED: in a very uncommon scenario, creating ScrollTriggers inside a DOMContentLoaded event might cause the start/end values to be miscalculated. See https://gsap.com/community/forums/topic/41267-scrolltrigger-breaks-on-refresh-when-using-domcontentloaded/ - FIXED: MotionPathHelper.editPath() may throw an error if you add an anchor to a path that has MULTIPLE segments (more than one "M" command). - FIXED: if you apply a snap to a ScrollTrigger that has a non-scrubbing animation, and the start is at 0 or less, it might restart the animation after the snap duration elapses on page load. - FIXED: if you remove() an animation from a timeline that was NOT its parent, it could cause an error. - FIXED: if you call CustomEase.get() in an SSR environment before the window object is defined, it could throw an error. See https://gsap.com/community/forums/topic/42510-gsapregisterplugin-in-nodejs-server/ - FIXED: some links in the TypeScript definitions file were incorrect since the gsap.com site launch. - FIXED: in very rare cases, a CustomEase might end at something like 0.999999999 instead of 1 progress-wise (so values wouldn't quite land at the destination). That's resolved now. - FIXED: if you clearProps on a target that contains individual transform component values applied in a CSS rule (like translate, rotate, or scale), it may not properly clear the transform. See https://gsap.com/community/forums/topic/43073-separate-transform-properties-like-rotate-and-scale-behave-differently-then-a-combined-transform/ - FIXED: regression in Flip.fit() could cause the width/height of the initial state not to be factored in, but only if there was a non-zero duration. - FIXED: an Angular issue related to SVG elements that return an empty getBBox() which could cause an error due to the temporary reparenting and re-assigning the getBBox() method itself inside GSAP. See https://gsap.com/community/forums/topic/42859-gsap-321-override-of-the-svg-api-method-getbbox-removes-angular-dblclick-binding-from-dom-element/ - FIXED: if you disable() and then change the scroll position and then enable() an Observer, on the next scroll it could factor in the pre-disabled scroll position in the calculations, thus firing an onDown() or onUp() (for example) incorrectly. - FIXED: if you restart() a zero-duration timeline that has an onComplete which already fired, it will fire that again after the restart(). See #604 - FIXED: zero-duration tweens wouldn't resolve then() Promises. See #590 - FIXED: TypeScript definition for getById() allows for undefined as a return type. See #589 - FIXED: ScrollSmoother doesn't set overscroll-behavior: none on the HTML/BODY anymore due to a Safari bug that caused that to stop the page from scrolling at all. See https://gsap.com/community/forums/topic/43802-loading-maps-api-scrollsmoother-in-safari-173-breaks-mousewheel-scroll-for-the-page/ - FIXED: PixiPlugin better accommodates the changes in Pixi.js version 7+, like fillColor and strokeColor. See #580
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
The text was updated successfully, but these errors were encountered: