From c4cf454cf03790214ee166988ef0d00eaa91a04f Mon Sep 17 00:00:00 2001 From: Lauren <61048546+laurenashleigh@users.noreply.github.com> Date: Tue, 11 Nov 2025 16:40:23 +0000 Subject: [PATCH] Alerting: Fix label value dropdown suggestions in alert rule editor (#113702) --- .../components/rule-editor/labels/LabelsField.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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) {