From d7cd52161fce0061fe2ba7ccc235a904ddaa77a9 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Wed, 17 Jun 2020 12:46:11 +0100 Subject: [PATCH] Fix SkipStep in tour directive was looking at wrong DOM selector it needs to be skipStepIfVisible --- .../directives/components/application/umbtour.directive.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbtour.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbtour.directive.js index 01d73568ec..eb521312fc 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbtour.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbtour.directive.js @@ -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; } } }