Skip to content

Commit 255117d

Browse files
committed
test: use scrollIntoView instead of scroll to fix the e2e tests
1 parent 94adbdd commit 255117d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

demo/src/components/MyTour.vue

+6-7
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,17 @@ export default {
6464
],
6565
callbacks: {
6666
onPreviousStep: this.myCustomPreviousStepCallback,
67-
onNextStep: this.myCustomNextStepCallback,
68-
onStop: () => {
69-
window.scroll({
70-
top: 0,
71-
behavior: 'smooth'
72-
})
73-
}
67+
onNextStep: this.myCustomNextStepCallback
7468
}
7569
}
7670
},
7771
mounted: function () {
7872
this.$tours['myTour'].start()
73+
74+
// A dynamically added onStop callback
75+
this.callbacks.onStop = () => {
76+
document.querySelector('#v-step-0').scrollIntoView({behavior: 'smooth'})
77+
}
7978
},
8079
methods: {
8180
nextStep () {

0 commit comments

Comments
 (0)