DateTimePicker: fix time-spinner not scroll to right position

This commit is contained in:
jesse-li
2019-08-01 18:31:39 +08:00
committed by hetech
parent 31cb7d3036
commit 744bad1f96

View File

@@ -231,7 +231,7 @@
},
handleScroll(type) {
const value = Math.min(Math.floor((this.$refs[type].wrap.scrollTop - (this.scrollBarHeight(type) * 0.5 - 10) / this.typeItemHeight(type) + 3) / this.typeItemHeight(type)), (type === 'hours' ? 23 : 59));
const value = Math.min(Math.round((this.$refs[type].wrap.scrollTop - (this.scrollBarHeight(type) * 0.5 - 10) / this.typeItemHeight(type) + 3) / this.typeItemHeight(type)), (type === 'hours' ? 23 : 59));
this.modifyDateField(type, value);
},