Skip to content

Commit 7ea0933

Browse files
authored
Merge pull request Expensify#63865 from daledah/fix/63417
fix: handle navigation back for button with dropdown menu
2 parents 5b2de95 + 793c4d9 commit 7ea0933

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/components/ButtonWithDropdownMenu/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ function ButtonWithDropdownMenu<IValueType>({
223223
setIsMenuVisible(false);
224224
onOptionsMenuHide?.();
225225
}}
226+
shouldHandleNavigationBack
226227
onModalShow={onOptionsMenuShow}
227228
onItemSelected={(selectedSubitem, index, event) => {
228229
onSubItemSelected?.(selectedSubitem, index, event);

src/components/PopoverMenu.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ type PopoverMenuProps = Partial<PopoverModalProps> & {
158158

159159
/** Used to locate the component in the tests */
160160
testID?: string;
161+
162+
/** Whether handle navigation back when modal show. */
163+
shouldHandleNavigationBack?: boolean;
161164
};
162165

163166
const renderWithConditionalWrapper = (shouldUseScrollView: boolean, contentContainerStyle: StyleProp<ViewStyle>, children: ReactNode): React.JSX.Element => {
@@ -209,6 +212,7 @@ function PopoverMenu({
209212
shouldUseModalPaddingStyle,
210213
shouldAvoidSafariException = false,
211214
testID,
215+
shouldHandleNavigationBack,
212216
}: PopoverMenuProps) {
213217
const styles = useThemeStyles();
214218
const theme = useTheme();
@@ -405,6 +409,7 @@ function PopoverMenu({
405409
setEnteredSubMenuIndexes(CONST.EMPTY_ARRAY);
406410
onClose();
407411
}}
412+
shouldHandleNavigationBack={shouldHandleNavigationBack}
408413
isVisible={isVisible}
409414
onModalHide={handleModalHide}
410415
onModalShow={onModalShow}

0 commit comments

Comments
 (0)