Giter Site home page Giter Site logo

Destroy/initiate issue about jquery-wizard HOT 8 CLOSED

outprove avatar outprove commented on June 21, 2024
Destroy/initiate issue

from jquery-wizard.

Comments (8)

kflorence avatar kflorence commented on June 21, 2024

@outprove Thanks for reporting. I will take a look when I have some free time.

from jquery-wizard.

kflorence avatar kflorence commented on June 21, 2024

@outprove I looked at the JSFiddle example briefly and I noticed several problems, although I don't see how any of them could cause the behavior you're experiencing:

  • you don't need to apply any wizard-* classes yourself -- the plugin will take care of this for you.
  • not every step needs to have it's own branch. the wizard itself is the default branch, so steps can just be children of the wizard (unless branches are needed).
  • by default, the wizard will transition to the data-state provided -- so you don't need to manually provide all of those transitions yourself. If you want to make sure the .val() of the current step is not blank before proceeding, you can do that once in the beforeForward event handler.

from jquery-wizard.

kflorence avatar kflorence commented on June 21, 2024

It will be difficult to try to reproduce this case outside of that JSFiddle since there is so much stuff going on. If anyone can reproduce this using a unit test, that would be preferable.

from jquery-wizard.

outprove avatar outprove commented on June 21, 2024

@kflorence I'm actually using a database procedure to dynamically genereate the JS/HTML based on a user-customizable questionnaire. (Hence the excessive branches/transitions for every question, I never know what I'll need in terms of complexity of dependencies ). I'll attempt to reproduce with a stripped down test.

from jquery-wizard.

outprove avatar outprove commented on June 21, 2024

I simplified it, I simply used the first included example (and stripped it to the first one at that.) Here's the jsfiddle:

https://jsfiddle.net/ed1rb2fr/17/

To reproduce it:

  1. Start the wizard by clicking on the button
  2. Enter a value in name, and hit forward
  3. At the second step hit destroy wizard
  4. Click startwizard again, the first step shows again properly
  5. Hit forward

You'll see then instead of just the second step, you'll see the second step and the result shown together. This doesnt happen during the first pass of the wizard if you dont destroy it.

Thanks!

from jquery-wizard.

kflorence avatar kflorence commented on June 21, 2024

@outprove thanks for taking the time to do that, sorry I've been so busy, haven't had time to take a look yet. Perhaps I can get to it this weekend.

from jquery-wizard.

outprove avatar outprove commented on June 21, 2024

@kflorence FYI, I figured out what the issue was - for some reason if you destroy and then reinstitute the wizard, the click event gets added again. I added a step in the destroy function that specifically unbinds the click event for both forward and backward:
( jQuery(self.elements.forward).off("click");
jQuery(self.elements.backward).off("click");)

That seemed to do the trick.

from jquery-wizard.

kflorence avatar kflorence commented on June 21, 2024

@outprove thanks for digging into it. Sorry that I haven't had time to be more responsive. It sounds like this might be something that can be patched in the code. I'll take a look when I get the chance.

from jquery-wizard.

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.