mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
parent
ea5b9fdc97
commit
87b250d7e2
@ -19,6 +19,7 @@ import { useStyles2 } from '../../themes/ThemeContext';
|
|||||||
import { t, Trans } from '../../utils/i18n';
|
import { t, Trans } from '../../utils/i18n';
|
||||||
import { ButtonGroup } from '../Button';
|
import { ButtonGroup } from '../Button';
|
||||||
import { getModalStyles } from '../Modal/getModalStyles';
|
import { getModalStyles } from '../Modal/getModalStyles';
|
||||||
|
import { getPortalContainer } from '../Portal/Portal';
|
||||||
import { ToolbarButton } from '../ToolbarButton';
|
import { ToolbarButton } from '../ToolbarButton';
|
||||||
import { Tooltip } from '../Tooltip/Tooltip';
|
import { Tooltip } from '../Tooltip/Tooltip';
|
||||||
|
|
||||||
@ -123,7 +124,8 @@ export function TimeRangePicker(props: TimeRangePickerProps) {
|
|||||||
isDismissable: true,
|
isDismissable: true,
|
||||||
isOpen,
|
isOpen,
|
||||||
shouldCloseOnInteractOutside: (element) => {
|
shouldCloseOnInteractOutside: (element) => {
|
||||||
return !buttonRef.current?.contains(element);
|
const portalContainer = getPortalContainer();
|
||||||
|
return !buttonRef.current?.contains(element) && !portalContainer.contains(element);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
overlayRef
|
overlayRef
|
||||||
|
Loading…
Reference in New Issue
Block a user