Time Picker: Fix "Fiscal year start month" selection behaviour (#98576)

don't close overlay when interacting with portal elements (e.g. dropdowns)
This commit is contained in:
Ashley Harrison 2025-01-07 13:43:42 +00:00 committed by GitHub
parent ea5b9fdc97
commit 87b250d7e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,6 +19,7 @@ import { useStyles2 } from '../../themes/ThemeContext';
import { t, Trans } from '../../utils/i18n';
import { ButtonGroup } from '../Button';
import { getModalStyles } from '../Modal/getModalStyles';
import { getPortalContainer } from '../Portal/Portal';
import { ToolbarButton } from '../ToolbarButton';
import { Tooltip } from '../Tooltip/Tooltip';
@ -123,7 +124,8 @@ export function TimeRangePicker(props: TimeRangePickerProps) {
isDismissable: true,
isOpen,
shouldCloseOnInteractOutside: (element) => {
return !buttonRef.current?.contains(element);
const portalContainer = getPortalContainer();
return !buttonRef.current?.contains(element) && !portalContainer.contains(element);
},
},
overlayRef