diff --git a/x-pack/plugins/observability/public/pages/slo_edit/components/slo_edit_form_definition_custom_kql.tsx b/x-pack/plugins/observability/public/pages/slo_edit/components/slo_edit_form_definition_custom_kql.tsx index dd9a26488c2c2..2d13548c7c8e9 100644 --- a/x-pack/plugins/observability/public/pages/slo_edit/components/slo_edit_form_definition_custom_kql.tsx +++ b/x-pack/plugins/observability/public/pages/slo_edit/components/slo_edit_form_definition_custom_kql.tsx @@ -63,7 +63,7 @@ export function SloEditFormDefinitionCustomKql({ control, trigger }: Props) { required: true, validate: (value) => indices.some((index) => valueMatchIndex(value, index.name)), }} - render={({ field }) => ( + render={({ field, fieldState }) => ( { field.onChange(label); }} - isInvalid={!indicesNames.some((index) => valueMatchIndex(field.value, index.label))} + isInvalid={ + fieldState.isDirty && + !indicesNames.some((index) => valueMatchIndex(field.value, index.label)) + } placeholder={i18n.translate( 'xpack.observability.slos.sloEdit.sloDefinition.customKql.index.selectIndex', {