Skip to content

Commit

Permalink
refactor!: Expose function instead menu wrapper ref directly (fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasenkoo committed Jan 4, 2025
1 parent 32b2d63 commit c7c7556
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ export interface PublicMethods extends MethodOptions {
switchView: (view: MenuView, instance?: number) => void;
toggleMenu: () => void;
handleFlow: (step?: number) => void;
dpWrapMenuRef: Ref<HTMLElement | null>;
getDpWrapMenuRef: () => Ref<HTMLElement | null>;
}

type InternalModelValue = Date | Date[] | null;
Expand Down
4 changes: 3 additions & 1 deletion src/VueDatePicker/VueDatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,8 @@
dpMenuRef.value?.handleFlow(skipStep);
};
const getDpWrapMenuRef = () => dpWrapMenuRef;
onClickOutside(dpWrapMenuRef, inputRef as unknown as MaybeElementRef, (evt: PointerEvent) =>
clickOutside(validateBeforeEmit, evt),
);
Expand All @@ -552,6 +554,6 @@
switchView,
toggleMenu,
handleFlow,
dpWrapMenuRef,
getDpWrapMenuRef,
});
</script>

0 comments on commit c7c7556

Please sign in to comment.