Skip to content

Commit

Permalink
Merge pull request #51645 from truph01/fix/51016-unable-to-select-pay…
Browse files Browse the repository at this point in the history
…ment-option

fix: Unable to select payment option in the dropdown in expense preview in the main chat
  • Loading branch information
aldo-expensify authored Oct 30, 2024
2 parents 96a9af4 + 21fc562 commit eb7c813
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
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

0 comments on commit eb7c813

Please sign in to comment.