I can prevent user for clicking other button component that route to outside current component using overlay.
But if user clicking back browser button, the tour is still running.
so i use navigation guard and search the classname like this
beforeRouteLeave (to, from, next) {
const tourOverlay = document.getElementsByClassName('shepherd-modal-is-visible')[0]
const tourStep = document.getElementsByClassName('shepherd-enabled')[0]
if (tourOverlay && tourStep) {
tourOverlay.remove()
tourStep.tourStep()
}
next()
}
Is there a best practice to achieve this?