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.
Fixed the issue on v6. Please see https://github.com/techlab/jquery-smartwizard/releases/tag/v6.0.1
Demo: http://techlaboratory.net/projects/demo/jquery-smart-wizard/v6/#step-1