Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

fix(web): unmount form fields when shouldRender is false (#21323)

chanx6acaf12da49a
diff --git a/web/src/components/dynamic-form.tsx b/web/src/components/dynamic-form.tsx
index 2ce1b74fc9..84307c82c5 100644
--- a/web/src/components/dynamic-form.tsx
+++ b/web/src/components/dynamic-form.tsx
@@ -946,10 +946,14 @@ const DynamicForm = {
const shouldShow = field.shouldRender
? field.shouldRender(formValues)
: true;
+ // `shouldRender === false` unmounts the field entirely (no DOM),
+ // instead of leaving it hidden. `field.hidden` keeps the previous
+ // hidden-class behavior since it's a separate static concern.
+ if (!shouldShow) return null;
return (
<div
key={field.name}
- className={cn({ hidden: field.hidden || !shouldShow })}
+ className={cn({ hidden: field.hidden })}
>
<RenderField
field={field}