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

History back on step1 sucks #152

Closed
visualight opened this issue Aug 24, 2022 · 1 comment · Fixed by #155
Closed

History back on step1 sucks #152

visualight opened this issue Aug 24, 2022 · 1 comment · Fixed by #155

Comments

@visualight
Copy link

visualight commented Aug 24, 2022

Describe the bug
Cannot history back() on step 1 when anchor navigation is enabled

To Reproduce

  1. Enable default smartWizard configuration with enableNavigation = true.
  2. Click button next 3 times to nav to other tab-pane.
  3. Click the previous navigation button of the browser (history back()).
  4. All step work with the history back button of the browser except step 1.

FIX

  1. Edit jquery.smartWizard.js

  2. Goto method : _setEvents

  3. Locate the verification below
    if(idx && _this3._isShowable(_this3.steps.eq(idx))) {...}

  4. Replace with :
    if(idx !== undefined && _this3._isShowable(_this3.steps.eq(idx))) {...}

In fact, idx return a zero (0) value for step 1 ... so you cannot simply verify idx as a boolean value (0 - null is false).
idx !== undefined // verify if value is defined

@techlab techlab closed this as completed in 4b29697 Oct 3, 2022
@techlab
Copy link
Owner

techlab commented Oct 3, 2022

Fixed the issue, thanks for reporting @visualight

techlab added a commit that referenced this issue Oct 3, 2022
Fix #152: History back on step1 not working
techlab added a commit that referenced this issue Oct 3, 2022
Fix #152: History back on step1 not working
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants