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

Commit

Permalink
fix: Datepicker menu closing with custom click outside directives (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasenkoo committed Nov 27, 2021
1 parent 95b2ff2 commit 28bead5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Vue3DatePicker/components/DatepickerMenu.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template>
<div
:id="uid ? `dp-menu-${uid}` : null"
ref="dpMenuRef"
role="dialog"
aria-label="Datepicker menu"
:class="dpMenuClass"
Expand Down Expand Up @@ -167,6 +168,7 @@
});
const slots = useSlots();
const calendarWrapperRef = ref(null);
const dpMenuRef = ref(null);
const calendarWidth = ref(0);
const menuMount = ref(false);
Expand All @@ -179,6 +181,12 @@
if (!props.inline) {
nextTick(() => emit('dpOpen'));
}
const menu = unrefElement(dpMenuRef);
if (menu) {
menu.addEventListener('pointerdown', (e) => {
e.stopImmediatePropagation();
});
}
});
const {
Expand Down

3 comments on commit 28bead5

@vanling
Copy link

@vanling vanling commented on 28bead5 Dec 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can really really use this functionality right now ^^

@Jasenkoo
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vanling I know, there are a lot of changes in this version, the deploy date is set for December 15th (Wednesday next week). It is currently in the testing phase, if everything is ok, it will be sooner (earliest next weekend).

@vanling
Copy link

@vanling vanling commented on 28bead5 Dec 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! Thank you.

Please sign in to comment.