Skip to content

History back on step1 sucks #152

@visualight

Description

@visualight

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions