usablica / intro.js

Lightweight, user-friendly onboarding tour library
http://introjs.com
Other
22.8k stars 2.59k forks source link

onexit not fired if intro exited via intro.exit() #255

Closed mgiraldo closed 7 years ago

mgiraldo commented 10 years ago

For this sample code: test.html

<a href='#' data-intro='Hello!<br />wait 3 seconds for automated close (onexit will not fire)'>one</a>

<a href='#' data-intro='Hello step two!'>two</a>

test.js

    var timerID;
    var myAlert = function () { alert("tutorial over!"); };
    var myintro = introJs();
    myintro.onexit(function() {
        myAlert();
        window.clearTimeout(timerID);
    });
    myintro.start();
    var quitIntro = function () {
        alert("automated quit!");
        myintro.exit();
    }
    timerID = window.setTimeout(quitIntro,3000);

The onexit event is not fired when the intro is closed programmatically via intro.exit().

I made a JSFiddle for this.

raahede commented 10 years ago

The same seems to go for oncomplete, plus when you exit through keypress.

Henri-K commented 9 years ago

same as #242

guncha commented 8 years ago

Just got caught by the same issue. How this makes sense is beyond me.

AdriVanHoudt commented 7 years ago

This has been added here https://github.com/usablica/intro.js/commit/66b2f1a18ba143eca593fc4f05e1b5861f0d5cce#diff-42068bed56449c4ec84ddf8745e56b7cR426 which is 1, weird to have that in that commit, 2 an undocumented fix, 3 not yet released

afshinm commented 7 years ago

Fixed.