diff --git a/src/features/clusters/upsert/components/InstanceFormInputs.tsx b/src/features/clusters/upsert/components/InstanceFormInputs.tsx index 5b43cf25d..d6223864e 100644 --- a/src/features/clusters/upsert/components/InstanceFormInputs.tsx +++ b/src/features/clusters/upsert/components/InstanceFormInputs.tsx @@ -75,6 +75,16 @@ export function InstanceFormInputs({ autoCapitalize="none" autoComplete="off" autoCorrect="off" + onChange={e => { + field.onChange(e); + const value = e.target.value; + const isLocalhost = value === 'localhost' || value === '127.0.0.1'; + const secureFieldState = form.getFieldState(`instances.${index}.secure`); + + if (isLocalhost && !secureFieldState.isDirty) { + form.setValue(`instances.${index}.secure`, 'false'); + } + }} />