diff --git a/src/useClickOutside.ts b/src/useClickOutside.ts index 3c8597f..fe67b12 100644 --- a/src/useClickOutside.ts +++ b/src/useClickOutside.ts @@ -80,7 +80,11 @@ function useClickOutside( const handleInitialMouse = useEventCallback((e: MouseEvent) => { const currentTarget = getRefTarget(ref); - if (currentTarget && contains(currentTarget, e.target as any)) { + if ( + currentTarget && + contains(currentTarget, e.target as any) && + currentTarget !== e.target + ) { waitingForTrigger.current = true; } });