Skip to content

Commit

Permalink
check inside shadow dom for use-outside-click
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Melloni committed Sep 27, 2022
1 parent 060f37b commit aed22ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/@headlessui-react/src/hooks/use-outside-click.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export function useOutsideClick(
'mousedown',
(event) => {
if (enabledRef.current) {
initialClickTarget.current = event.target
initialClickTarget.current = event.composedPath?.()?.[0] || event.target
}
},
true
Expand Down
2 changes: 1 addition & 1 deletion packages/@headlessui-vue/src/hooks/use-outside-click.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function useOutsideClick(
'mousedown',
(event) => {
if (enabled.value) {
initialClickTarget.value = event.target
initialClickTarget.value = event.composedPath?.()?.[0] || event.target
}
},
true
Expand Down

0 comments on commit aed22ef

Please sign in to comment.