[Logs UI] Prevent the "Alerts and rules" context menu from sticking (#106408)
This commit is contained in:
parent
63ffc9fc47
commit
a397e0f60a
|
@ -54,13 +54,18 @@ export const AlertDropdown = () => {
|
|||
setPopoverOpen(true);
|
||||
}, [setPopoverOpen]);
|
||||
|
||||
const openFlyout = useCallback(() => {
|
||||
setFlyoutVisible(true);
|
||||
closePopover();
|
||||
}, [setFlyoutVisible, closePopover]);
|
||||
|
||||
const menuItems = useMemo(() => {
|
||||
return [
|
||||
<EuiContextMenuItem
|
||||
disabled={!canCreateAlerts}
|
||||
icon="bell"
|
||||
key="createLink"
|
||||
onClick={() => setFlyoutVisible(true)}
|
||||
onClick={openFlyout}
|
||||
toolTipContent={!canCreateAlerts ? readOnlyUserTooltipContent : undefined}
|
||||
toolTipTitle={!canCreateAlerts ? readOnlyUserTooltipTitle : undefined}
|
||||
>
|
||||
|
@ -76,7 +81,7 @@ export const AlertDropdown = () => {
|
|||
/>
|
||||
</EuiContextMenuItem>,
|
||||
];
|
||||
}, [manageAlertsLinkProps, canCreateAlerts]);
|
||||
}, [manageAlertsLinkProps, canCreateAlerts, openFlyout]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
Loading…
Reference in a new issue