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

Commit 795f7b6

Browse files
committed
fix: Menu position jumping when placed on top when switching months
1 parent 9ddeab1 commit 795f7b6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Vue3DatePicker/components/composition/calendar.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,18 @@ export const useCalendar = (props: UseCalendar, emit: VueEmit): IUseCalendar =>
7373
);
7474
const seconds = ref<number | number[]>(props.range ? [0, 0] : 0);
7575

76+
watch(
77+
calendars,
78+
() => {
79+
setTimeout(() => {
80+
if (props.openOnTop) {
81+
emit('dpOpen');
82+
}
83+
}, 0);
84+
},
85+
{ deep: true },
86+
);
87+
7688
onMounted(() => {
7789
mapInternalModuleValues();
7890

0 commit comments

Comments
 (0)