-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Velocity mutating options object w/ sequences #265
Labels
Comments
@fattenap yep, that's indeed a problem. @julianshapiro probably means wrapping all |
fattenap
changed the title
transitions taking longer to start for each subsequent animation when using the stagger option
options mutating object
Aug 24, 2014
Agreed. The fix is simple. Expect this in the next update. Thanks, guys. |
julianshapiro
changed the title
Velocity mutating options object
Velocity mutating options object w/ sequences
Aug 24, 2014
Done. Please test, confirm it works, and get back to me. Thank you so much! |
Tested and it works. Thanks! |
Rycochet
pushed a commit
that referenced
this issue
Aug 3, 2020
Apply `overflow: hidden` when using the slide commands. Closes #260. Sequence (UI pack effect) options object no longer gets externally modified by Velocity. Closes #265. Fixed bug where tweens would jump when dequeuing custom queues. Closes #262. (The reverse command now only applies to the default effects queue; reverse cannot be used with custom queues or parallel queueing (queue: false).) Fixed unit conversion bug on the `x` property of SVG elements.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I store animation options in an array. For example
var optionsArray = [{stagger: 75, drag: true}]
. I then pass optionsArray[0] to Velocity as the options argument.Velocity("transition.slideUpIn", optionsArray[0]);
This passes in optionsArray[0] as a reference to Velocity. Velocity then adds a
delay
property to the passed in options object, effectively mutating my options object. Now optionsArray[0] looks like this => {delay:875, stagger:75, drag: true;}The next time I call
Velocity("transition.slideUpIn", optionsArray[0]);
it passes in {delay:875, stagger:75, drag: true;} which delays the animation. This compounds for each subsequent call as delay gets longer and longer.Here's a CodePen showing the issue http://codepen.io/fattenap/pen/IglzH
Would it be possible for Velocity to take a copy of passed in options if it intends on mutating it. This way my object won't be affected.
Thanks
The text was updated successfully, but these errors were encountered: