techlab/jquery-smartwizard

goToStep method fails to recognize the correct step.

DriverOp opened this issue · 1 comments

Version affected: 5.1.1
Any browser.

When the "goToStep" method is invoked, it sometimes fails to correctly recognize the step number.

To cause this error, it is sufficient to pass a numeric string as a parameter, for example "4" instead of the integer 4.

I have traced the problem to _getNextShowable. The parameter received has no type control. So if a string is received, within the for statement, a concatenation occurs between string parameter and the integer 1 in the adder.

My proposed solution is to use the parseInt() function in the method's parameter that manipulate the current, next and previous step number.