Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/components/Hoverable/ActiveHoverable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function ActiveHoverable({onHoverIn, onHoverOut, shouldHandleScroll, shouldFreez
setIsHovered(false);
};

document.addEventListener('mouseover', unsetHoveredIfOutside);
document.addEventListener('mouseover', unsetHoveredIfOutside, true);

return () => document.removeEventListener('mouseover', unsetHoveredIfOutside);
}, [isHovered, elementRef, shouldFreezeCapture]);
Expand Down Expand Up @@ -126,13 +126,13 @@ function ActiveHoverable({onHoverIn, onHoverOut, shouldHandleScroll, shouldFreez
(event: MouseEvent) => {
// Check if the blur event occurred due to clicking outside the element
// and the wrapperView contains the element that caused the blur and reset isHovered
if (!elementRef.current?.contains(event.target as Node) && !elementRef.current?.contains(event.relatedTarget as Node)) {
if (!elementRef.current?.contains(event.target as Node) && !elementRef.current?.contains(event.relatedTarget as Node) && !shouldFreezeCapture) {
setIsHovered(false);
}

onBlur?.(event);
},
[onBlur],
[onBlur, shouldFreezeCapture],
);

const handleAndForwardOnMouseMove = useCallback(
Expand Down
1 change: 1 addition & 0 deletions src/pages/home/report/ReportActionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,7 @@ function ReportActionItem({
<Hoverable
shouldHandleScroll
isDisabled={draftMessage !== undefined}
shouldFreezeCapture={isPaymentMethodPopoverActive}
>
{(hovered) => (
<View style={highlightedBackgroundColorIfNeeded}>
Expand Down