Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shepherd.Tour constructor definition of steps errors with showOn being undefined #114

Closed
jspeaks opened this issue Apr 26, 2016 · 7 comments · Fixed by #485
Closed

Shepherd.Tour constructor definition of steps errors with showOn being undefined #114

jspeaks opened this issue Apr 26, 2016 · 7 comments · Fixed by #485

Comments

@jspeaks
Copy link

jspeaks commented Apr 26, 2016

When trying to define Shepherd Tour via a steps property passed to the constructor I receive an error "cannot read property showOn of undefined". The steps are very primitive and work with the addStep method:

var tour = new Shepherd.Tour({
    defaults:{
        classes:"shepherd-theme-default"
    }
    ,steps:[
        {
            id:"s1"
            ,text:"Find out about Feature A"
            ,attachTo:".featureA right"
        }
        ,{
                id:"s2"
            ,text:"Find out about Feature B"
            ,attachTo:".featureB right"
        }
    ]
});
tour.start();
@zackbloom
Copy link
Contributor

This is not a feature as far as I know. You should create steps using the addStep method.

@andrewkdouglas
Copy link

This should be reopened as it is a feature in the docs:

https://github.com/HubSpot/shepherd/blob/ecc84623df9eb21e6935e01240c4e7d078552bdd/docs/intro.md#tour-options

Cannot read property 'showOn' of undefined at Tour.show (shepherd.js:708) at Tour.next (shepherd.js:641) at Tour.start (shepherd.js:733)

@zackbloom zackbloom reopened this Aug 19, 2016
@FallingSnow
Copy link

I just tried this too as it is in the docs. Got the same error.

@jgiovanni
Copy link

+1

@Pamblam
Copy link

Pamblam commented Nov 13, 2017

What it says in the docs is An array of **Step instances**

What it doesn't say in the docs is how to create a Step instance manually.

The signature is new Shepherd.Step(tour_instance, options);

My question is, how the actual fuck are we supposed to supply the Tour instance to Tour constructor? IDK if the chicken came before the egg but it definitely came before the chicken sandwich...

@RobbieTheWagner
Copy link
Member

@Pamblam I think you are supposed to create a new tour manually, then manually pass it to each manually created step. That being said, we should probably just rewrite steps to take the same format as addStep or just remove it from the docs.

@stale
Copy link

stale bot commented Jan 13, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants