usablica / intro.js

Lightweight, user-friendly onboarding tour library
http://introjs.com
Other
22.8k stars 2.59k forks source link

multi page introJs not working with Turbolinks #419

Closed ericenns closed 3 years ago

ericenns commented 9 years ago

I have a rails 4 app which I have set up a multi page.

I have been trying to enable Turbolinks which my tour works fine when I go in the forward direction, but when I hit the back button it fails. It seem like there is still an object hanging around in the page, as the js is not reloaded. Is there a way to clean the IntroJs object I tried saving it to a window variable and then setting it to null when the page transitions but that doesn't seem to work.

What happens is basically if I go from page A to page B, where the tour starts on page A and has 8 steps and then transitions to page B which has 4 steps. And I go back to page A, which turbolinks doesn't refresh the page just replaces the contents of body. Then I start the tour on page A and get to step 4 and it ends since page B ends at step 4.

I would just like to know if there is a way to clean the introJs object.

ericenns commented 9 years ago

So I did some further inspection and I don't have any problems if I click the buttons to navigate, I only have issues if I use keyboard navigation.

So I suspect that the previous tours event listeners for keydown are still active.

stale[bot] commented 4 years ago

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.