From e0773471fe4c56e6f4ce02c986ffc1e0a6b06504 Mon Sep 17 00:00:00 2001 From: Regina Obe Date: Mon, 7 Sep 2026 10:04:54 -0400 Subject: [PATCH] Fix dynamic type function not receiving correct state for collection row fields When a schema field uses a dynamic type function (type as a function) and is rendered inside a collection (e.g., chain tasks), the function always received the top-level schema data instead of the row-level data. This caused the field to fall through to its default type, ignoring the actual field values in the row. Pass the parent-path state to the dynamic type function so it receives the correct context for collection row fields. --- web/pgadmin/static/js/SchemaView/MappedControl.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/pgadmin/static/js/SchemaView/MappedControl.jsx b/web/pgadmin/static/js/SchemaView/MappedControl.jsx index 78353a07097..c0bb2561fb7 100644 --- a/web/pgadmin/static/js/SchemaView/MappedControl.jsx +++ b/web/pgadmin/static/js/SchemaView/MappedControl.jsx @@ -401,7 +401,12 @@ export const MappedFormControl = ({ } if (typeof (field.type) === 'function') { - const typeProps = evalFunc(null, field.type, state); + let typeState = state; + if (accessPath && accessPath.length > 1) { + const parentPath = accessPath.slice(0, -1); + typeState = schemaState.value(parentPath); + } + const typeProps = evalFunc(null, field.type, typeState); newProps = { ...newProps, ...typeProps,