elm-animator icon indicating copy to clipboard operation
elm-animator copied to clipboard

`Animator.previous` returns incorrect state

Open absynce opened this issue 4 years ago • 3 comments

Issue Animator.previous always shows the initial state instead of the previous state.

Expected Animator.previous to show the previous state.

Example Ellies

Issue since version 1.0.2. It worked as expected in 1.0.1.

absynce avatar Jun 12 '20 21:06 absynce

Hello there! I'm facing the same issue. I started git bisecting and it seems the culprit commit is https://github.com/mdgriffith/elm-animator/commit/4461b4f7274177b895a1fcf93ef1df56e403353c that appears between 1.0.1 and 1.0.2 I can confirm 1.0.1 doesn't have this issue.

Now I don't think I can go further without investing a lot of time :-(

ps: Great lib @mdgriffith, I love it so far!

matsumonkie avatar Jul 17 '20 12:07 matsumonkie

I've created a small reproduction of this bug here: https://ellie-app.com/brTmsMSBJfFa1

Luftzig avatar Nov 04 '20 13:11 Luftzig

I've managed to create a workaround for displaying the entering and leaving items. The key components are:

        arrivedPage =
            Animator.arrived model.page
        currentPage =
            Animator.current model.page
        oldPage =
            if arrivedPage == currentPage then
                Nothing
            else
                Just arrivedPage

Hopefully I'll find the time to add to my example above as well.

Luftzig avatar Nov 05 '20 07:11 Luftzig