sjmc11 / tourguide-js

TourGuide is a Javascript library for creating user tours and on-boarding steps for your apps.
https://tourguidejs.com
MIT License
616 stars 31 forks source link

TourGuideStep's beforeEnter event exits tour if Promise is not resolved when the Promise's function finishes #21

Closed jmanos closed 11 months ago

jmanos commented 1 year ago

While using the beforeEnter event in a TourGuideStep, the tour will exit if the promise is not resolved before the Promise's function finishes executing. The backdrop is removed and users can interact with the page. Once the Promise is resolved, the tour starts up again at that step, and the backdrop comes back.

For example:

beforeEnter() {
    return new Promise(function (resolve, reject) {
        setTimeout(function () {  resolve(); }, 10000);
        //the tour exits until the Promise is resolved
    });
}

I would expect the tour to not exit and instead wait for the promise to resolve. In this case, it should continue to show the backdrop while waiting. If the user clicks anywhere during the wait, the tour should exit and not start up again once the Promise is resolved.

I am using TourGuideJs v0.0.10 in Chrome.

sjmc11 commented 11 months ago

Hi @jmanos, thanks for raising the issue. I have just released 0.0.11 to NPM which should address the problem. Re-open the issue if the problem persists. Thanks