diff --git a/x-pack/plugins/fleet/public/components/package_policy_actions_menu.tsx b/x-pack/plugins/fleet/public/components/package_policy_actions_menu.tsx index 9743135d5f1c1..7b0a300ac9dc8 100644 --- a/x-pack/plugins/fleet/public/components/package_policy_actions_menu.tsx +++ b/x-pack/plugins/fleet/public/components/package_policy_actions_menu.tsx @@ -28,6 +28,7 @@ export const PackagePolicyActionsMenu: React.FunctionComponent<{ const { getHref } = useLink(); const hasWriteCapabilities = useCapabilities().write; const refreshAgentPolicy = useAgentPolicyRefresh(); + const [isActionsMenuOpen, setIsActionsMenuOpen] = useState(false); const onEnrollmentFlyoutClose = useMemo(() => { return () => setIsEnrollmentFlyoutOpen(false); @@ -48,7 +49,10 @@ export const PackagePolicyActionsMenu: React.FunctionComponent<{ // , setIsEnrollmentFlyoutOpen(true)} + onClick={() => { + setIsActionsMenuOpen(false); + setIsEnrollmentFlyoutOpen(true); + }} key="addAgent" > )} - + setIsActionsMenuOpen(isOpen)} + /> ); };