Skip to content

Commit 60ace8e

Browse files
authored
Merge pull request #5954 from Countly/ar2rsawseen/master
Scroll to top in drawer step changes
2 parents e75e82e + e2207c5 commit 60ace8e

File tree

1 file changed

+8
-0
lines changed
  • frontend/express/public/javascripts/countly/vue/components

1 file changed

+8
-0
lines changed

frontend/express/public/javascripts/countly/vue/components/form.js

+8
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,12 @@
172172
},
173173
prevStep: function() {
174174
this.setStep(this.currentStepIndex - 1, 'prev');
175+
this.scrollToTop();
175176
},
176177
nextStep: function() {
177178
this.beforeLeavingStep("onlyCurrent");
178179
this.setStep(this.currentStepIndex + 1, 'next', !this.isCurrentStepValid);
180+
this.scrollToTop();
179181
},
180182
reset: function() {
181183
var self = this;
@@ -233,6 +235,12 @@
233235
}
234236
});
235237
}
238+
},
239+
scrollToTop: function() {
240+
var container = this.$el.getElementsByClassName("cly-vue-drawer__steps-container")[0];
241+
if (container && container.scrollTop) {
242+
container.scrollTop = 0;
243+
}
236244
}
237245
}
238246
};

0 commit comments

Comments
 (0)