From 8050729e6fb83fb89cb8bbf43be7828e122aa479 Mon Sep 17 00:00:00 2001 From: centdix <40307056+centdix@users.noreply.github.com> Date: Thu, 9 Oct 2025 18:25:50 +0200 Subject: [PATCH] fix showexpr in inputtransformform (#6782) --- frontend/src/lib/components/InputTransformForm.svelte | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/InputTransformForm.svelte b/frontend/src/lib/components/InputTransformForm.svelte index c88f92759c..c5d2f65209 100644 --- a/frontend/src/lib/components/InputTransformForm.svelte +++ b/frontend/src/lib/components/InputTransformForm.svelte @@ -311,6 +311,7 @@ } } + // This only works if every fields are static, as we can't eval javascript function handleFieldVisibility( schema: Schema | any, arg: InputTransform | any, @@ -326,15 +327,20 @@ [argName]: currentValue } + let hasJavascript = false + // Extract values from InputTransform objects in otherArgs Object.keys(otherArgs ?? {}).forEach((key) => { + if (otherArgs[key].type === 'javascript') { + hasJavascript = true + } const otherArg = otherArgs[key] const otherArgValue = otherArg.type === 'static' ? otherArg.value : otherArg.expr contextArgs[key] = otherArgValue }) const shouldShow = computeShow(argName, schemaProperty.showExpr, contextArgs) - if (shouldShow) { + if (shouldShow || hasJavascript) { hidden = false } else if (!hidden) { hidden = true @@ -443,7 +449,7 @@ ) -{#if arg != undefined} +{#if arg != undefined && !hidden}