Skip to content

Commit

Permalink
add comments to clarify handling of extra anchor refs
Browse files Browse the repository at this point in the history
  • Loading branch information
ishpaul777 committed Jan 23, 2025
1 parent c181839 commit fdd058a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/PopoverProvider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ function PopoverContextProvider(props: PopoverContextProps) {
if (elementContains(activePopoverRef.current?.ref, e.target) || elementContains(activePopoverRef.current?.anchorRef, e.target)) {
return;
}
// incase there are any extra anchor refs where the popover should not close on click
// Incase there are any extra anchor refs where the popover should not close on click
// for example, the case when the QAB tooltip is clicked it closes the popover this will prevent that
if (activePopoverExtraAnchorRefs?.some((ref: RefObject<View | HTMLElement | Text>) => elementContains(ref, e.target))) {
return;
}
Expand Down

0 comments on commit fdd058a

Please sign in to comment.