Code Monkey home page Code Monkey logo

Comments (5)

cosminstefanxp avatar cosminstefanxp commented on July 22, 2024

I'm having a similar issue. When I'm calling showStep(x); while in a onPrev callback, I don't get redirected to where I should. Apparently, after debugging it a bit, it seems that at first the proper bubble is created, but then, after my onPrev callback method is executed, it continues with the original onPrev/onBack behaviour, thus redirecting me again to the previous step.

from hopscotch.

gkoo avatar gkoo commented on July 22, 2024

Try returning false in your callback to denote that the tour should not try to proceed to the next (or previous) step. Let me know if that works for you.

from hopscotch.

cosminstefanxp avatar cosminstefanxp commented on July 22, 2024

I've tried returning false, but in that case it exits the tour completely (as defined in: https://github.com/linkedin/hopscotch/blob/master/js/hopscotch-0.1.2.js#L1648 ). Maybe this behaviour should be changed to stop the default behaviour when returning false?

I've changed the mentioned line (L1648) to return this; and now I'm getting the needed behaviour if I'm using something like:

onPrev: function(){
      hopscotch.showStep(5);
      return false;
}

from hopscotch.

gkoo avatar gkoo commented on July 22, 2024

Good catch, thanks for bringing this to my attention. This commit (35a2b2d) should fix it for you. Feel free to reopen this issue if you still have problems. 🍻

from hopscotch.

cosminstefanxp avatar cosminstefanxp commented on July 22, 2024

Works great. Thank you!

from hopscotch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.