Skip to content

Commit bafcd27

Browse files
committed
fix: prevent mobile web popover from closing instantly on Copy Link selection
Guard onItemSelected in SearchTypeMenuNarrow to not close the popover when shouldCloseModalOnSelect is false, matching the same pattern used in ButtonWithDropdownMenu and ThreeDotsMenu.
1 parent d21acbf commit bafcd27

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/pages/Search/SearchTypeMenuNarrow.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,11 @@ function SearchTypeMenuNarrow({queryJSON, onTabPress}: SearchTypeMenuNarrowProps
250250
horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT,
251251
vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.BOTTOM,
252252
}}
253-
onItemSelected={() => {
253+
onItemSelected={(item) => {
254254
setRestoreFocusType(CONST.MODAL.RESTORE_FOCUS_TYPE.PRESERVE);
255-
setSavedSearchToModifyKey(null);
255+
if (item?.shouldCloseModalOnSelect !== false) {
256+
setSavedSearchToModifyKey(null);
257+
}
256258
}}
257259
menuItems={popoverMenuItems}
258260
anchorRef={menuAnchorRef}

0 commit comments

Comments
 (0)