Conversation
This fixes broken behavior and enable animation only on swiping.
| const { shouldAnimate } = this.state; | ||
|
|
||
| const columnIndex = getIndex(this.context.router.history.location.pathname); | ||
| const shouldAnimate = Math.abs(this.lastIndex - columnIndex) === 1; |
There was a problem hiding this comment.
Shouldn't we animate if we move to the previous / next tab? Might help with discoverability of the feature and - subjective - I think it looks nice.
There was a problem hiding this comment.
I also feel that it improves perceived performance.
There was a problem hiding this comment.
When we use animation for location change based transition, columnIndex is already new one before transition, whereas it's old one on swiping based transition. So destination column will be rendered before animated transition.
I don't feel it improves perceived performance so much, on my (slow) device which takes some freeze time anyway. Also transition to rendering looks not bad, but different from behavior on swiping.
Well...I wonder that if we make same behavior as swiping, i.e. render destination while/after transition.
This fixes broken behavior and enable animation only on swiping.
onTransitionEndcalled beforeonChangeIndexifanimateTransitionsis false. In a result,location.pathnamewon't be updated on swiping.animateTransitonvalue which is set before transition, i.e. we need to maintaintrueas much as possible to animate swiping.This also removes animation from transition caused by location changing.
Before
After
cc @sorin-davidoi