shipshapecode / angular-shepherd

An Angular wrapper for the site tour library Shepherd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

requiredElements not working as intended

hafnerpw opened this issue · comments

image
This is simply not working. I can add any selector I want, the Tour WILL always start. I can't call addSteps but it will ALWAYS display an empty popup. This is very frustrating if the required element is inside ngIf and is only displayed to some users. In my case other users that don't have this element will see an empty popup. Please fix.

@w-hafner I believe that is the intended behavior. The documentation is misleading though. You can see here

if (!this.requiredElementsPresent()) {
tour.addStep({
buttons: [{
text: 'Exit',
action: tour.cancel
}],
id: 'error',
title: this.errorTitle,
text: [this.messageForUser]
});
return;
that if the required elements are not present, it will add a single step to the tour, displaying whatever title and error message you set.