fix(editor): Prevent updating node parameter value if it hasn't changed (#9535)
This commit is contained in:
committed by
GitHub
parent
f914c97d11
commit
63990f14e3
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div :class="$style.editor">
|
||||
<div ref="htmlEditor"></div>
|
||||
<div ref="htmlEditor" data-test-id="html-editor-container"></div>
|
||||
<slot name="suffix" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -244,7 +244,6 @@ onMounted(() => {
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
htmlEditorEventBus.off('format-html', formatHtml);
|
||||
emit('update:model-value', readEditorValue());
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1189,6 +1189,13 @@ function valueChanged(value: NodeParameterValueType | {} | Date) {
|
||||
if (remoteParameterOptionsLoading.value) {
|
||||
return;
|
||||
}
|
||||
// Only update the value if it has changed
|
||||
const oldValue = node.value?.parameters
|
||||
? nodeHelpers.getParameterValue(node.value?.parameters, props.parameter.name, '')
|
||||
: undefined;
|
||||
if (oldValue !== undefined && oldValue === value) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (props.parameter.name === 'nodeCredentialType') {
|
||||
activeCredentialType.value = value as string;
|
||||
|
||||
@@ -163,7 +163,6 @@ onMounted(() => {
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
codeNodeEditorEventBus.off('error-line-number', highlightLine);
|
||||
emit('update:model-value', readEditorValue());
|
||||
});
|
||||
|
||||
function line(lineNumber: number): Line | null {
|
||||
|
||||
Reference in New Issue
Block a user