Skip to content

Commit

Permalink
feat: Pass 'PointerEvent' as second param to custom onClickOutside (r…
Browse files Browse the repository at this point in the history
…esolves #1040)
  • Loading branch information
Jasenkoo committed Dec 28, 2024
1 parent 265b487 commit b729ca1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/VueDatePicker/VueDatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -526,16 +526,18 @@
dpMenuRef.value?.switchView(view, instance);
};
const clickOutside = (validateBeforeEmit: () => boolean) => {
if (defaultedConfig.value.onClickOutside) return defaultedConfig.value.onClickOutside(validateBeforeEmit);
const clickOutside = (validateBeforeEmit: () => boolean, evt: PointerEvent) => {
if (defaultedConfig.value.onClickOutside) return defaultedConfig.value.onClickOutside(validateBeforeEmit, evt);
return closeMenu(true);
};
const handleFlow = (skipStep = 0) => {
dpMenuRef.value?.handleFlow(skipStep);
};
onClickOutside(dpWrapMenuRef, inputRef as unknown as MaybeElementRef, () => clickOutside(validateBeforeEmit));
onClickOutside(dpWrapMenuRef, inputRef as unknown as MaybeElementRef, (evt: PointerEvent) =>
clickOutside(validateBeforeEmit, evt),
);
defineExpose({
closeMenu,
Expand Down

0 comments on commit b729ca1

Please sign in to comment.