Closed renakollmannsuhr closed 2 years ago
I ran into the same issue. I was able to get it working by instead doing this:
let intro = introJs.setOptions({ steps: [...] });
intro.start();
intro.goToStepNumber(num);
Hope that helps.
@iubkud That workaround does it for me. Thanks!
This is expected and is because goToStepNumber
is an async
function now, which doesn't return an IntroJS
object and instead, it returns Promise<IntroJS>
. See https://github.com/usablica/intro.js/blob/master/src/index.js#L207-L211
Description
goToStepNumber(num) function is not working on version 6 like it did with version 5.1. How would I go to a specific step number in version 6? Is anyone else having this issue?
Expected Behavior
Expected to start tour at the specified step number using version 6 intro.js.
Actual Behavior
Recieved error: Uncaught TypeError: introJs(...).setOptions(...).goToStepNumber(...).start is not a function)
And the tour would not start.
Example (recommended)
In a test app using intro.js version 5.1 I was able to initiate a tour with: introJs().setOptions({ steps:[ .....]}).goToStepNumber(num).start();
I also added the data-step='' attributes to the specified elements.
However the same code in version 6 resulted in an error.