From 146e822359863fa97139a1d8277a608d0d1ea86a Mon Sep 17 00:00:00 2001 From: FitseTLT Date: Thu, 6 Mar 2025 01:08:36 +0300 Subject: [PATCH] fix safari bug --- src/components/PopoverMenu.tsx | 6 +++++- .../Search/SearchPageHeader/SearchTypeMenuPopover.tsx | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/PopoverMenu.tsx b/src/components/PopoverMenu.tsx index 428f6799d3f56..ab5a44c7e2756 100644 --- a/src/components/PopoverMenu.tsx +++ b/src/components/PopoverMenu.tsx @@ -137,6 +137,9 @@ type PopoverMenuProps = Partial & { /** Should we apply padding style in modal itself. If this value is false, we will handle it in ScreenWrapper */ shouldUseModalPaddingStyle?: boolean; + /** Whether we want to avoid the safari exception of ignoring shouldCallAfterModalHide */ + shouldAvoidSafariException?: boolean; + /** Used to locate the component in the tests */ testID?: string; }; @@ -187,6 +190,7 @@ function PopoverMenu({ shouldUseModalPaddingStyle, shouldUseNewModal, testID, + shouldAvoidSafariException = false, }: PopoverMenuProps) { const styles = useThemeStyles(); const theme = useTheme(); @@ -212,7 +216,7 @@ function PopoverMenu({ setEnteredSubMenuIndexes([...enteredSubMenuIndexes, index]); const selectedSubMenuItemIndex = selectedItem?.subMenuItems.findIndex((option) => option.isSelected); setFocusedIndex(selectedSubMenuItemIndex); - } else if (selectedItem.shouldCallAfterModalHide && !isSafari()) { + } else if (selectedItem.shouldCallAfterModalHide && (!isSafari() || shouldAvoidSafariException)) { onItemSelected?.(selectedItem, index); close( () => { diff --git a/src/components/Search/SearchPageHeader/SearchTypeMenuPopover.tsx b/src/components/Search/SearchPageHeader/SearchTypeMenuPopover.tsx index e519a8a22c8cb..fd6c6fb89acdb 100644 --- a/src/components/Search/SearchPageHeader/SearchTypeMenuPopover.tsx +++ b/src/components/Search/SearchPageHeader/SearchTypeMenuPopover.tsx @@ -211,6 +211,7 @@ function SearchTypeMenuPopover({queryJSON, searchName, shouldGroupByReports}: Se shouldUseScrollView shouldUseModalPaddingStyle={false} innerContainerStyle={{paddingBottom: unmodifiedPaddings.bottom}} + shouldAvoidSafariException /> )}