Skip to content

Commit

Permalink
[core] fix(PanelStack): do not trigger unintended animations (#3787)
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinsum authored and adidahiya committed Nov 3, 2019
1 parent 793a177 commit ead4079
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/src/components/panel-stack/panelStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ export class PanelStack extends AbstractPureComponent2<IPanelStackProps, IPanelS

public componentDidUpdate(prevProps: IPanelStackProps, _prevState: IPanelStackState, _snapshot: {}) {
super.componentDidUpdate(prevProps, _prevState, _snapshot);
const stackLength = this.props.stack != null ? this.props.stack.length : 0;
const prevStackLength = prevProps.stack != null ? prevProps.stack.length : 0;

if (this.props.stack !== prevProps.stack && prevProps.stack != null) {
if (stackLength !== prevStackLength && prevProps.stack != null) {
this.setState({
direction: prevProps.stack.length - this.props.stack.length < 0 ? "push" : "pop",
stack: this.props.stack.slice().reverse(),
Expand Down

0 comments on commit ead4079

Please sign in to comment.