diff --git a/webpack/components/extensions/RegistrationCommands/fields/ActivationKeys.js b/webpack/components/extensions/RegistrationCommands/fields/ActivationKeys.js index 1fe0a6c6310..3a8805efba9 100644 --- a/webpack/components/extensions/RegistrationCommands/fields/ActivationKeys.js +++ b/webpack/components/extensions/RegistrationCommands/fields/ActivationKeys.js @@ -38,10 +38,16 @@ const ActivationKeys = ({ }; // Validate field when hostgroup is changed (host group may have some keys) - useEffect(() => { + useEffect(() => { handleInvalidField('Activation Keys', akHasValidValue(hostGroupId, pluginValues?.activationKeys, hostGroupActivationKeys)); }, [handleInvalidField, hostGroupId, hostGroupActivationKeys, pluginValues]); + useEffect(() => { + if (activationKeys?.length === 1) { + updatePluginValues([activationKeys[0]?.name]); + } + }, [activationKeys?.length]); + return (