Skip to content

Commit fa1d0a4

Browse files
QiuShuiBaidolymood
authored andcommitted
fix(time-picker): the selected value was changed when open again (#648)
1 parent 41e4b1d commit fa1d0a4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/time-picker/time-picker.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,10 @@
259259
const value = this.value
260260
const minTime = this.minTime
261261
// fix the value last choose was changed when time-picker is opened again
262-
if (value < Math.floor(minTime / MINUTE_TIMESTAMP) * MINUTE_TIMESTAMP) {
262+
const comparativeTime = (this.min || this.min === 0)
263+
? +minTime
264+
: Math.floor(minTime / MINUTE_TIMESTAMP) * MINUTE_TIMESTAMP
265+
if (value < comparativeTime) {
263266
this.selectedIndex = [0, 0, 0]
264267
} else {
265268
// calculate dayIndex

0 commit comments

Comments
 (0)