diff --git a/public/app/features/variables/pickers/OptionsPicker/OptionsPicker.tsx b/public/app/features/variables/pickers/OptionsPicker/OptionsPicker.tsx index aa733ac7496ea..5c27487970daa 100644 --- a/public/app/features/variables/pickers/OptionsPicker/OptionsPicker.tsx +++ b/public/app/features/variables/pickers/OptionsPicker/OptionsPicker.tsx @@ -53,7 +53,9 @@ export const optionPickerFactory = <Model extends VariableWithOptions | Variable }; } - const isMfeTeamFilter = state.fnGlobalState.FNDashboard && state.fnGlobalState.metadata.teams.length; + const p = getVariablesState(rootStateKey, state).optionsPicker; + const isMfeTeamFilter = + state.fnGlobalState.FNDashboard && state.fnGlobalState.metadata.teams.length && p.id === 'team'; const teamFilter = isMfeTeamFilter ? state.fnGlobalState.metadata.teams.map((t) => ({ @@ -63,8 +65,6 @@ export const optionPickerFactory = <Model extends VariableWithOptions | Variable })) : []; - const p = getVariablesState(rootStateKey, state).optionsPicker; - return { picker: { ...p, ...(teamFilter.length && { options: [...p.options, ...teamFilter] }) }, mfeState: state.fnGlobalState,