Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N8N-3267 Drop-downs break after removing expressions #3094

Merged
merged 3 commits into from
Apr 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions packages/editor-ui/src/components/ParameterInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ export default mixins(

return false;
},
expressionValueComputed (): NodeParameterValue | null {
expressionValueComputed (): NodeParameterValue | string[] | null {
if (this.areExpressionsDisabled) {
return this.value;
}
Expand Down Expand Up @@ -733,7 +733,7 @@ export default mixins(

this.$emit('textInput', parameterData);
},
valueChanged (value: string | number | boolean | Date | null) {
valueChanged (value: string[] | string | number | boolean | Date | null) {
if (value instanceof Date) {
value = value.toISOString();
}
Expand Down Expand Up @@ -768,7 +768,14 @@ export default mixins(
this.expressionEditDialogVisible = true;
this.trackExpressionEditOpen();
} else if (command === 'removeExpression') {
this.valueChanged(this.expressionValueComputed !== undefined ? this.expressionValueComputed : null);
let value = this.expressionValueComputed;

if (this.parameter.type === 'multiOptions' && typeof value === 'string') {
value = (value || '').split(',')
.filter((value) => (this.parameterOptions || []).find((option) => option.value === value));
}

this.valueChanged(typeof value !== 'undefined' ? value : null);
} else if (command === 'refreshOptions') {
this.loadRemoteParameterOptions();
}
Expand Down