From 38298a792ebcd21cec343e80c18e76ebd66873c4 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Mon, 27 Mar 2023 19:11:25 +0200 Subject: [PATCH] Reference selected variable by ID rather than by name --- .../src/components/inputs/variable-picker.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/designer/designer_packages/elsa-workflows-designer/src/components/inputs/variable-picker.tsx b/src/designer/designer_packages/elsa-workflows-designer/src/components/inputs/variable-picker.tsx index bc5f43f69..09cfca5db 100644 --- a/src/designer/designer_packages/elsa-workflows-designer/src/components/inputs/variable-picker.tsx +++ b/src/designer/designer_packages/elsa-workflows-designer/src/components/inputs/variable-picker.tsx @@ -1,4 +1,4 @@ -import {Component, Prop, h} from '@stencil/core'; +import {Component, h, Prop} from '@stencil/core'; import {SyntaxNames, Variable} from "../../models"; import {ActivityInputContext} from "../../services/activity-input-driver"; import {getPropertyValue} from "../../utils"; @@ -21,8 +21,7 @@ export class VariablePickerInput { const fieldId = inputDescriptor.name; const displayName = inputDescriptor.displayName; const description = inputDescriptor.description; - const value = getPropertyValue(inputContext) as Variable; - let currentValue = value; + let currentValue = getPropertyValue(inputContext) as Variable; if (currentValue == undefined) { const defaultValue = inputDescriptor.defaultValue; @@ -39,7 +38,7 @@ export class VariablePickerInput { {variables.map((variable: Variable) => { const variableName = variable?.name; const variableId = variable?.id; - const isSelected = variableName == currentValue?.name; + const isSelected = variableId == currentValue?.id; return ; })}