Skip to content

Commit

Permalink
fix: trigger active pathway from pathways
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanLovely committed Aug 22, 2019
1 parent 71d4f55 commit 057dd0a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
11 changes: 1 addition & 10 deletions packages/micro-journeys/src/interactive-pathway.js
Expand Up @@ -52,6 +52,7 @@ class BoltInteractivePathway extends withLitHtml() {

setActive(isActive = true) {
this.isActivePathway = isActive;
this.setActiveStep(0);
this.triggerUpdate();
}

Expand All @@ -66,16 +67,6 @@ class BoltInteractivePathway extends withLitHtml() {

connectedCallback() {
super.connectedCallback();
if (this.getAttribute('total-steps')) {
console.error(
'The attribute "total-steps" is present and should not be.',
);
}

// If we fire `this.setActiveStep(0)` here it won't work since parents are connected before children, so we place it in `setTimeout` to put it at bottom of call stack
setTimeout(() => {
this.setActiveStep(0);
}, 0); // @todo replace this with a nice onScroll/inView trigger
}

/**
Expand Down
4 changes: 0 additions & 4 deletions packages/micro-journeys/src/interactive-step.js
Expand Up @@ -44,10 +44,6 @@ class BoltInteractiveStep extends withLitHtml() {

connectedCallback() {
super.connectedCallback();
if (this.getAttribute('step')) {
console.error('The attribute "step" is present and should not be.');
}

this.addEventListener('bolt:transitionend', this.handleAnimationEnd);
}

Expand Down

0 comments on commit 057dd0a

Please sign in to comment.