fix(editor): Allow switch to Fixed for boolean and number parameters with invalid expressions (#12948)

This commit is contained in:
Charlie Kolb
2025-01-31 12:00:04 +01:00
committed by GitHub
parent c60cc43124
commit 118be24d25
2 changed files with 91 additions and 1 deletions

View File

@@ -908,11 +908,16 @@ async function optionSelected(command: string) {
if (isResourceLocatorParameter.value && isResourceLocatorValue(props.modelValue)) {
valueChanged({ __rl: true, value, mode: props.modelValue.mode });
} else {
let newValue = typeof value !== 'undefined' ? value : null;
let newValue: NodeParameterValueType | {} = typeof value !== 'undefined' ? value : null;
if (props.parameter.type === 'string') {
// Strip the '=' from the beginning
newValue = modelValueString.value ? modelValueString.value.toString().substring(1) : null;
} else if (newValue === null) {
// Invalid expressions land here
if (['number', 'boolean'].includes(props.parameter.type)) {
newValue = props.parameter.default;
}
}
valueChanged(newValue);
}