Skip to content
This repository was archived by the owner on Apr 17, 2022. It is now read-only.

Commit 2a08c8e

Browse files
committed
fix: Prevent initial transition on open if value is set
1 parent 2e2424c commit 2a08c8e

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/Vue3DatePicker/components/Calendar.vue

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@
247247
const monthProp = toRef(props, 'month');
248248
const yearProp = toRef(props, 'year');
249249
const prevDate = ref();
250+
const startTransitions = ref(false);
250251
251252
const weekDays = computed(() => {
252253
return getDayNames(props.locale, +props.weekStart);
@@ -268,10 +269,15 @@
268269
? transitions.value.next
269270
: transitions.value.previous;
270271
prevDate.value = newDate;
271-
showCalendar.value = false;
272-
nextTick(() => {
273-
showCalendar.value = true;
274-
});
272+
if (startTransitions.value) {
273+
showCalendar.value = false;
274+
nextTick(() => {
275+
showCalendar.value = true;
276+
});
277+
}
278+
}
279+
if (!startTransitions.value) {
280+
startTransitions.value = true;
275281
}
276282
});
277283

0 commit comments

Comments
 (0)