diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_define_package_policy.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_define_package_policy.tsx index c66a28944ea71..64837b208ae45 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_define_package_policy.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_define_package_policy.tsx @@ -47,7 +47,7 @@ export const StepDefinePackagePolicy: React.FunctionComponent<{ const pkgPoliciesWithMatchingNames = (agentPolicy.package_policies as PackagePolicy[]) .filter((ds) => Boolean(ds.name.match(pkgPoliciesNamePattern))) .map((ds) => parseInt(ds.name.match(pkgPoliciesNamePattern)![1], 10)) - .sort(); + .sort((a, b) => a - b); updatePackagePolicy({ // FIXME: Improve package policies name uniqueness - https://github.com/elastic/kibana/issues/72948