You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a bug in _nextStep method which results in:
Cannot read property 'element' of undefined
Expected Behavior
_nextStep should not execute when right arrow is pressed while on last item in introItem set.
Actual Behavior
When one uses arrow keys to move through items, after reaching last element on the item set and pressing right arrow key produces an error, because this._currentStep exceeds the this._introItems array, resulting in call on undefined.
Errors and Screenshots (optional)
Example (recommended)
Press right arrow key while being on last item in the set of Intro js
Environment (optional)
Problem is with code logic, not the environment.
Problem can be solved by simple if check:
if (typeof (this._currentStepNumber) !== 'undefined') {
_forEach(this._introItems, function (item, i) {
if( item.step === this._currentStepNumber ) {
this._currentStep = i - 1;
this._currentStepNumber = undefined;
}
}.bind(this));
}
// added check here before _currentStep mutation
if (this._introItems.length - 1 < this._currentStep + 1) {
return;
}
if (typeof (this._currentStep) === 'undefined') {
this._currentStep = 0;
} else {
++this._currentStep;
}
The text was updated successfully, but these errors were encountered:
This does not throw an error, but ignores the user expectation, it should close the intro.
In case you want to close intro - simply add exit command: // added check here before _currentStep mutation if (this._introItems.length - 1 < this._currentStep + 1) { this.exit(); return; }
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Description
There is a bug in
_nextStep
method which results in:Expected Behavior
_nextStep
should not execute when right arrow is pressed while on last item in introItem set.Actual Behavior
When one uses arrow keys to move through items, after reaching last element on the item set and pressing right arrow key produces an error, because this._currentStep exceeds the this._introItems array, resulting in call on
undefined
.Errors and Screenshots (optional)
Example (recommended)
Press right arrow key while being on last item in the set of Intro js
Environment (optional)
Problem is with code logic, not the environment.
Problem can be solved by simple if check:
The text was updated successfully, but these errors were encountered: