From 331f3e2a58aa8d52d2625e9ab2a7ac85ce1da11e Mon Sep 17 00:00:00 2001 From: Brendan O'Handley Date: Thu, 15 Sep 2022 11:39:40 -0500 Subject: [PATCH] small fix for new variable editor types (#55195) --- .../graphite/components/GraphiteVariableEditor.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/public/app/plugins/datasource/graphite/components/GraphiteVariableEditor.tsx b/public/app/plugins/datasource/graphite/components/GraphiteVariableEditor.tsx index 96300703a56..1a9c0488830 100644 --- a/public/app/plugins/datasource/graphite/components/GraphiteVariableEditor.tsx +++ b/public/app/plugins/datasource/graphite/components/GraphiteVariableEditor.tsx @@ -30,14 +30,21 @@ export const GraphiteVariableEditor = (props: Props) => { width={25} value={value.queryType ?? GraphiteQueryType.Default} onChange={(selectableValue) => { - onChange({ + setValue({ ...value, queryType: selectableValue.value, }); + + if (value.target) { + onChange({ + ...value, + queryType: selectableValue.value, + }); + } }} /> - +