Fix SkipStep in tour directive was looking at wrong DOM selector it needs to be skipStepIfVisible

This commit is contained in:
Warren Buckley
2020-06-17 12:46:11 +01:00
parent 797e666e81
commit d7cd52161f

View File

@@ -264,13 +264,14 @@ In the following example you see how to run some custom logic before a step goes
// If the currentStep JSON object has 'skipStepIfVisible'
// It's a DOM selector - if we find it then we ship over this step
if(upcomingStep.skipStepIfVisible) {
let tryFindDomEl = document.querySelector(upcomingStep.element);
if(tryFindDomEl) {
if (upcomingStep.skipStepIfVisible) {
let tryFindDomEl = document.querySelector(upcomingStep.skipStepIfVisible);
if (tryFindDomEl) {
// check if element is visible:
if( tryFindDomEl.offsetWidth || tryFindDomEl.offsetHeight || tryFindDomEl.getClientRects().length ) {
// if it was visible then we skip the step.
nextStep();
return;
}
}
}