From 744bad1f9612881150784eb45f83ccd4d22b22ee Mon Sep 17 00:00:00 2001 From: jesse-li Date: Thu, 1 Aug 2019 18:31:39 +0800 Subject: [PATCH] DateTimePicker: fix time-spinner not scroll to right position --- packages/date-picker/src/basic/time-spinner.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/date-picker/src/basic/time-spinner.vue b/packages/date-picker/src/basic/time-spinner.vue index 06e690918..f6a1c8c2b 100644 --- a/packages/date-picker/src/basic/time-spinner.vue +++ b/packages/date-picker/src/basic/time-spinner.vue @@ -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); },