Fix column swiping animation logic (#15301)
From the start, swiping columns was highly unreliable because the logic could change `ReactSwipeableViews`'s `animateTransitions` property mid-swipe. PR #11200 partially fixed this, but at the unintended cost of disabling the swipe animation altogether. This PR changes the logic behind `shouldAnimate` to only disable the swiping animation at the end of a column change not initiated by `ReactSwipeableViews`. Co-authored-by: Claire <claire.github-309c@sitedethib.com>gh/stable
parent
9620ee90be
commit
0b437325dc
|
@ -75,8 +75,10 @@ class ColumnsArea extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps() {
|
componentWillReceiveProps() {
|
||||||
|
if (typeof this.pendingIndex !== 'number' && this.lastIndex !== getIndex(this.context.router.history.location.pathname)) {
|
||||||
this.setState({ shouldAnimate: false });
|
this.setState({ shouldAnimate: false });
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
if (!this.props.singleColumn) {
|
if (!this.props.singleColumn) {
|
||||||
|
|
Reference in New Issue