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
I've been playing around with Shepherd for a bit, and modified it for my own purposes (including adding some additional steps which seems odd aren't already in the source such as Tour.on("next",..) and "back" depending on if you're going forwards or backwards in the tour). Anywho, I thought it was a mistake on my part and binding the before-show event twice, but it seems that the native code fires it twice for every transition.
The issue
First off, a quick example of the behaviour can be seen here (JSFiddle) .
Mind you that the line numbers below may be one or two off because of my alterations to the library.
From what I can see, Step.hide() (L310) runs when tour.next is called - that method triggers a "before-hide" event accounting for the first one. In the bottom of this method, a new event is triggered with this.trigger('hide'); - suggesting the life-cycle of this step has completed.
The code now bounce to Tour.show() (L619) which eventually runs L648 this.currentStep.hide() which once again runs the above code, triggering another "before-hide" event.
Potential fix:
I tried deleting L647-649:
if (this.currentStep) {
this.currentStep.hide();
}
and removed the extra call to hide with the assumption that the element should already have been hidden. My tests worked identically, just without the extra method call, however, I'm not sure if there's a case where the initial call to hide() is not called.
The text was updated successfully, but these errors were encountered:
I've been playing around with Shepherd for a bit, and modified it for my own purposes (including adding some additional steps which seems odd aren't already in the source such as Tour.on("next",..) and "back" depending on if you're going forwards or backwards in the tour). Anywho, I thought it was a mistake on my part and binding the before-show event twice, but it seems that the native code fires it twice for every transition.
The issue
First off, a quick example of the behaviour can be seen here (JSFiddle) .
Mind you that the line numbers below may be one or two off because of my alterations to the library.
From what I can see,
Step.hide()
(L310) runs whentour.next
is called - that method triggers a "before-hide" event accounting for the first one. In the bottom of this method, a new event is triggered withthis.trigger('hide');
- suggesting the life-cycle of this step has completed.The code now bounce to
Tour.show()
(L619) which eventually runs L648this.currentStep.hide()
which once again runs the above code, triggering another "before-hide" event.Potential fix:
I tried deleting L647-649:
and removed the extra call to hide with the assumption that the element should already have been hidden. My tests worked identically, just without the extra method call, however, I'm not sure if there's a case where the initial call to hide() is not called.
The text was updated successfully, but these errors were encountered: