Skip to content

Commit

Permalink
feat: pass mouse event to onclickoutside callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakeii committed Oct 12, 2024
1 parent 08f012e commit 8f26001
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/util/on-click-outside.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const createListener = (node: HTMLElement, cb: () => void) => (e: MouseEvent) => {
const createListener = (node: HTMLElement, cb: (e: MouseEvent) => unknown) => (e: MouseEvent) => {
if (node.contains(e.target as Node)) {
return;
}
cb();
cb(e);
};

const onClickOutside = (node: HTMLElement, cb: () => void) => {
Expand Down

0 comments on commit 8f26001

Please sign in to comment.