jquery-smartwizard
jquery-smartwizard copied to clipboard
History back on step1 sucks
Describe the bug Cannot history back() on step 1 when anchor navigation is enabled
To Reproduce
- Enable default smartWizard configuration with enableNavigation = true.
- Click button next 3 times to nav to other tab-pane.
- Click the previous navigation button of the browser (history back()).
- All step work with the history back button of the browser except step 1.
FIX
-
Edit jquery.smartWizard.js
-
Goto method : _setEvents
-
Locate the verification below
if(idx && _this3._isShowable(_this3.steps.eq(idx))) {...} -
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