Skip to content

Commit d35877b

Browse files
committed
fix(component): Removing highlight
Highlight was getting removed even if the next target is the same target.
1 parent 7796e69 commit d35877b

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/components/VTour.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,12 @@ function resetTour() {
115115
}
116116
117117
function highlightTarget(lastStep = null) {
118-
document.querySelector(`${getStep.value.target}`).classList.add("vjt-highlight");
119-
if (lastStep != null) {
120-
document.querySelector(`${props.steps[lastStep].target}`).classList.remove("vjt-highlight");
121-
}
118+
let _nextStep = document.querySelector(`${getStep.value?.target}`);
119+
let _lastStep = document.querySelector(`${props.steps[lastStep]?.target}`);
120+
if(_nextStep === _lastStep) return;
121+
122+
_nextStep.classList.add("vjt-highlight");
123+
if (_lastStep != null) _lastStep.classList.remove("vjt-highlight");
122124
}
123125
124126
function recalculatePopper(lastStep) {

0 commit comments

Comments
 (0)