Skip to content

Commit

Permalink
DateTimePicker: fix time-spinner not scroll to right position
Browse files Browse the repository at this point in the history
  • Loading branch information
jesse-li authored and ziyoung committed Aug 1, 2019
1 parent 31cb7d3 commit 744bad1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/date-picker/src/basic/time-spinner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
Expand Down

0 comments on commit 744bad1

Please sign in to comment.