Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG - JavaScript ProgressBar Update function using step number instead of stepID when referencing data-step attribute #1122

Open
kevin-hine-innis opened this issue Oct 27, 2021 · 0 comments

Comments

@kevin-hine-innis
Copy link

The step data attribute is based on the step id, not the step number.
The step number changes when the number of steps changes.
So, in order to grab the a step by the data attribute, you need to use the id, not the number which may have changed.

The result of this bug is that the step buttons do not activate as intended.
To test this, create 3 steps/pages making the 2nd page hidden. If you then click next, it takes you to step 3, but step three will not activate.

This can be fixed by updating line 353 of UserForms.js from:
if (parseInt($element.data('step'), 10) === stepNumber && $element.is(':visible')) {

to:
if (parseInt($element.data('step'), 10) === (stepID + 1) && $element.is(':visible')) {
Also, the step data attribute uses a 1 based index, whereas the stepID passed to the function is 0 based (hence the +1 on the stepID).

I'm not setup, at the moment, to compile the JS, so I am not making a pull request at this time, but wanted to make sure the bug was noted beyond my commit logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants