From a6c8ee4a82e6055766dc1307f79c774c17bb5f4d Mon Sep 17 00:00:00 2001 From: Charlie Kolb Date: Fri, 8 Nov 2024 08:31:58 +0100 Subject: [PATCH] fix(editor): Cap NDV Output View Tab Index to prevent rare edge case (#11614) --- packages/editor-ui/src/components/RunData.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/editor-ui/src/components/RunData.vue b/packages/editor-ui/src/components/RunData.vue index 6000807958..351fdd8890 100644 --- a/packages/editor-ui/src/components/RunData.vue +++ b/packages/editor-ui/src/components/RunData.vue @@ -386,7 +386,10 @@ const currentOutputIndex = computed(() => { return props.overrideOutputs[0]; } - return outputIndex.value; + // In some cases nodes may switch their outputCount while the user still + // has a higher outputIndex selected. We could adjust outputIndex directly, + // but that loses data as we can keep the user selection if the branch reappears. + return Math.min(outputIndex.value, maxOutputIndex.value); }); const branches = computed(() => { const capitalize = (name: string) => name.charAt(0).toLocaleUpperCase() + name.slice(1);