Skip to content

Commit

Permalink
Update useClickOutside.ts (#4035)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshLumpkin authored Dec 5, 2023
1 parent 3b9af4c commit ebc97e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ui/src/composables/useClickOutside.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type MaybeArray<T> = T | T[]
const safeArray = <T>(a: MaybeArray<T>) => Array.isArray(a) ? a : [a]

export const useClickOutside = (elements: MaybeArray<MaybeRef<HTMLElement | undefined>>, cb: (el: HTMLElement) => void) => {
useCaptureEvent('click', (event: MouseEvent) => {
useCaptureEvent('mousedown', (event: MouseEvent) => {
const clickTarget = event.target as HTMLElement

if ((event.target as HTMLElement).shadowRoot) {
Expand Down

0 comments on commit ebc97e4

Please sign in to comment.