fix(editor): Code node overwrites code when switching nodes after edits (#13078)

This commit is contained in:
Elias Meire
2025-02-05 17:07:32 +01:00
committed by GitHub
parent 16d59e98ed
commit 00e3ebc9e2
5 changed files with 43 additions and 31 deletions

View File

@@ -118,7 +118,7 @@ const emit = defineEmits<{
const externalHooks = useExternalHooks();
const i18n = useI18n();
const nodeHelpers = useNodeHelpers();
const { callDebounced } = useDebounce();
const { debounce } = useDebounce();
const router = useRouter();
const workflowHelpers = useWorkflowHelpers({ router });
const telemetry = useTelemetry();
@@ -801,9 +801,9 @@ function onTextInputChange(value: string) {
emit('textInput', parameterData);
}
function valueChangedDebounced(value: NodeParameterValueType | {} | Date) {
void callDebounced(valueChanged, { debounceTime: 100 }, value);
}
const valueChangedDebounced = debounce(valueChanged, { debounceTime: 100 });
function onUpdateTextInput(value: string) {
valueChanged(value);
onTextInputChange(value);
@@ -1032,6 +1032,7 @@ defineExpose({
});
onBeforeUnmount(() => {
valueChangedDebounced.cancel();
props.eventBus.off('optionSelected', optionSelected);
});