Giter VIP home page Giter VIP logo

Comments (7)

ef4 avatar ef4 commented on August 26, 2024 2

This can close when #107 merges. Thanks.

from ember-animated.

willrax avatar willrax commented on August 26, 2024

Here are the screenshots of the issue after clicking back and forth a little bit:

Screen Shot 2019-05-08 at 8 57 16 AM

Screen Shot 2019-05-08 at 8 57 41 AM

from ember-animated.

ef4 avatar ef4 commented on August 26, 2024

Yes, making all interruptions work correctly is one of the founding reasons this library exist.

This is a bug in this particular demo, although I would like to change a default behavior to make this kind of bug harder to stumble into.

The collapse, shuffle, and shuffleWithStagger transitions all need to place the sentSprites into their final positions immediately as the transition begins:

for (let sprite of sentSprites) {
  sprite.moveToFinalPosition();
}

That fixes the bug.

I would like to make this behavior the default, but it will require a corresponding change to the way motions are defined, because right now they assume this behavior.

from ember-animated.

jamesplease avatar jamesplease commented on August 26, 2024

Thanks for the reply!

transitions all need to place the sentSprites into their final positions immediately as the transition begins

I don't fully understand the technical solution you described (as I'm not currently a user of the lib), but I have a follow up question: will items ever "jump" in the solution you described, or will they smoothly transition from the current animation into the new one?

from ember-animated.

ef4 avatar ef4 commented on August 26, 2024

In more detail: the sentSprites are present but invisible during all these transitions. That is, you always have two copies of each image: one in the sending component, and one in the receiving component. The demo always moves the receiving one and leaves the sending one invisible.

In an effort to be helpful, ember-animated pre-positions both the received and sent images at the initial position (the place where the move should start). But since the demo doesn't do anything with the sent image, the sent image lingers there in that position.

But when an interruption occurs, the sent image is still lingering in that weird position, and it can continue to influence the starting positions of the next transition.

The change I want to make is to not automatically move the sent sprites (and indeed, not automatically move any sprites), and instead require each motion to affirmatively declare when it wants a particular sprite to go to initial or final position whenever it expects one of those.

from ember-animated.

ef4 avatar ef4 commented on August 26, 2024

Nothing should ever jump. If you patch the code snippet I shared above into each of the three transition functions in that demo, everything is smooth no matter how many times you go back and forth clicking wildly.

Well, there is one exception in this demo, although it seems to be intentional. The z-index changes take place instantly, so that whatever images are the incoming ones jump above the outgoing ones.

Probably there is a different strategy that would avoid this, at the cost of sometimes allowing outgoing images to be above incoming ones.

from ember-animated.

jamesplease avatar jamesplease commented on August 26, 2024

Very cool. I appreciate the thorough response, @ef4 ! I wasnโ€™t able to change the example on the site, but itโ€™s nbd, I believe yaโ€™ ๐Ÿ™‚ .

Since it sounds like the resolution to this problem is known, would you like me to close this issue?

from ember-animated.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.