From 7e5d3efc52cf7a7b5cf23b61d143bcca672e7deb 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 0adfb0d4285..2e847b03aca 100644 --- a/web/pgadmin/static/js/SchemaView/MappedControl.jsx +++ b/web/pgadmin/static/js/SchemaView/MappedControl.jsx @@ -409,7 +409,12 @@ export const MappedFormControl = ({ // sibling fields from its own row, mirroring what field.cell() already // gets via its row argument. Existing field.type() callbacks that only // take a single argument are unaffected. - const typeProps = evalFunc(null, field.type, state, depVals); + 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, depVals); newProps = { ...newProps, ...typeProps,