fix(editor): Fix NDV unexpected re-render (#7532)

This commit is contained in:
Csaba Tuncsik 2023-10-30 09:22:08 +01:00 committed by GitHub
parent 233683ce1a
commit 2853fcff73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -28,7 +28,7 @@
teleported teleported
size="small" size="small"
:modelValue="currentNodeName" :modelValue="currentNodeName"
@update:modelValue="onSelect" @update:modelValue="onInputNodeChange"
:no-data-text="$locale.baseText('ndv.input.noNodesFound')" :no-data-text="$locale.baseText('ndv.input.noNodesFound')"
:placeholder="$locale.baseText('ndv.input.parentNodes')" :placeholder="$locale.baseText('ndv.input.parentNodes')"
filterable filterable
@ -432,9 +432,9 @@ export default defineComponent({
onUnlinkRun() { onUnlinkRun() {
this.$emit('unlinkRun'); this.$emit('unlinkRun');
}, },
onSelect(value: string) { onInputNodeChange(value: string) {
const index = this.parentNodes.findIndex((node) => node.name === value) + 1; const index = this.parentNodes.findIndex((node) => node.name === value) + 1;
this.$emit('select', value, index); this.$emit('changeInputNode', value, index);
}, },
onConnectionHelpClick() { onConnectionHelpClick() {
if (this.activeNode) { if (this.activeNode) {

View file

@ -69,7 +69,7 @@
@unlinkRun="() => onUnlinkRun('input')" @unlinkRun="() => onUnlinkRun('input')"
@runChange="onRunInputIndexChange" @runChange="onRunInputIndexChange"
@openSettings="openSettings" @openSettings="openSettings"
@select="onInputSelect" @changeInputNode="onInputNodeChange"
@execute="onNodeExecute" @execute="onNodeExecute"
@tableMounted="onInputTableMounted" @tableMounted="onInputTableMounted"
@itemHover="onInputItemHover" @itemHover="onInputItemHover"
@ -710,7 +710,7 @@ export default defineComponent({
pane, pane,
}); });
}, },
onInputSelect(value: string, index: number) { onInputNodeChange(value: string, index: number) {
this.runInputIndex = -1; this.runInputIndex = -1;
this.isLinkingEnabled = true; this.isLinkingEnabled = true;
this.selectedInput = value; this.selectedInput = value;