elm-animator
elm-animator copied to clipboard
`Animator.previous` returns incorrect state
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.
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!
I've created a small reproduction of this bug here: https://ellie-app.com/brTmsMSBJfFa1
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.