Skip to content

Keyboard events firing all tours custom callbacks #20

@zanedev

Description

@zanedev

The keyboard events are registered globally so if you have multiple tours in your app, it will fire the custom events for every tour. I ran into this with the stop callback, I was running some custom logic specific to each tour on the stop callback and it was running every single tour's stop logic when I hit the escape key instead of the running tour's stop callback.

I worked around it for now by checking that the current tour is running first in the callback:
if (this.$tours[this.tourName].isRunning)....

Possible fix: namespace the events or only register/unload them when a tour is in progress rather than on mount?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions