@@ -38,7 +38,9 @@ function initializeDefaults(params: InputParam[]): Record<string, unknown> {
3838 return defaults
3939}
4040
41- /** Read the current selection value from parent data, handling array context. */
41+ /** Read the current selection value from parent data, handling array context.
42+ * When data is already scoped to the array item (ArrayInput passes itemData),
43+ * the parent array won't exist in data.inputValues — fall back to direct read. */
4244function readCurrentValue (
4345 data : NodeData ,
4446 paramName : string ,
@@ -50,12 +52,14 @@ function readCurrentValue(
5052 if ( Array . isArray ( arr ) && arr [ arrayIndex ] ) {
5153 return arr [ arrayIndex ] [ paramName ] as string | undefined
5254 }
53- return undefined
55+ // data may already be scoped to the array item (via ArrayInput's itemData)
56+ return data . inputValues ?. [ paramName ] as string | undefined
5457 }
5558 return data . inputValues ?. [ paramName ] as string | undefined
5659}
5760
58- /** Read existing config from parent data, handling array context. */
61+ /** Read existing config from parent data, handling array context.
62+ * Falls back to direct read when data is already item-scoped. */
5963function readExistingConfig (
6064 data : NodeData ,
6165 paramName : string ,
@@ -68,7 +72,8 @@ function readExistingConfig(
6872 if ( Array . isArray ( arr ) && arr [ arrayIndex ] ) {
6973 return arr [ arrayIndex ] [ configKey ] as Record < string , unknown > | undefined
7074 }
71- return undefined
75+ // data may already be scoped to the array item (via ArrayInput's itemData)
76+ return data . inputValues ?. [ configKey ] as Record < string , unknown > | undefined
7277 }
7378 return data . inputValues ?. [ configKey ] as Record < string , unknown > | undefined
7479}
0 commit comments