diff --git a/public/app/features/alerting/unified/components/rule-editor/labels/LabelsField.tsx b/public/app/features/alerting/unified/components/rule-editor/labels/LabelsField.tsx index abde3d3a4f7..b1571a2a6a5 100644 --- a/public/app/features/alerting/unified/components/rule-editor/labels/LabelsField.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/labels/LabelsField.tsx @@ -262,13 +262,13 @@ export function LabelsWithSuggestions({ dataSourceName }: LabelsWithSuggestionsP selectedKey ); - const values = useMemo(() => { - return getValuesForLabel(selectedKey); - }, [selectedKey, getValuesForLabel]); - return ( {fields.map((field, index) => { + // Get the values for this specific row's key directly without memoization + const currentKey = labelsInSubform[index]?.key || ''; + const valuesForCurrentKey = getValuesForLabel(currentKey); + return (
{ if (newValue) {