Skip to content
Merged
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
12 changes: 11 additions & 1 deletion src/components/Search/FilterDropdowns/DropdownButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, {useMemo, useRef, useState} from 'react';
import type {View} from 'react-native';
import {useOnyx} from 'react-native-onyx';
import Button from '@components/Button';
import CaretWrapper from '@components/CaretWrapper';
import PopoverWithMeasuredContent from '@components/PopoverWithMeasuredContent';
Expand All @@ -10,6 +11,7 @@ import useStyleUtils from '@hooks/useStyleUtils';
import useThemeStyles from '@hooks/useThemeStyles';
import useWindowDimensions from '@hooks/useWindowDimensions';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';

type PopoverComponentProps = {
closeOverlay: () => void;
Expand Down Expand Up @@ -51,6 +53,8 @@ function DropdownButton({label, value, viewportOffsetTop, PopoverComponent}: Dro
vertical: 0,
});

const [willAlertModalBecomeVisible] = useOnyx(ONYXKEYS.MODAL, {selector: (modal) => modal?.willAlertModalBecomeVisible, canBeMissing: true});

const onTriggerLayout = () => {
triggerRef.current?.measureInWindow((x, y, _, height) => {
setPopoverTriggerPosition({
Expand All @@ -65,7 +69,13 @@ function DropdownButton({label, value, viewportOffsetTop, PopoverComponent}: Dro
* position of the trigger
*/
const toggleOverlay = () => {
setIsOverlayVisible((previousValue) => !previousValue);
setIsOverlayVisible((previousValue) => {
if (!previousValue && willAlertModalBecomeVisible) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coming from a DB, willAlertModalBecomeVisible was always true in native apps, thus it caused tapping on other dropdowns ("Status", "Date", "From") to be unable to open

More details here: #64871 (comment)

return false;
}

return !previousValue;
});
};

/**
Expand Down