@@ -282,7 +282,7 @@ export const FormContextProvider = <T extends ConfigurableProps>({
282282 const  propsToEnable : Record < string ,  boolean >  =  { } ; 
283283
284284 for  ( const  prop  of  configurableProps )  { 
285-  if  ( prop . optional )  { 
285+  if  ( prop . optional   &&   ! enabledOptionalProps [ prop . name ] )  { 
286286 const  value  =  configuredProps [ prop . name  as  keyof  ConfiguredProps < T > ] ; 
287287 if  ( value  !==  undefined )  { 
288288 propsToEnable [ prop . name ]  =  true ; 
@@ -300,6 +300,7 @@ export const FormContextProvider = <T extends ConfigurableProps>({
300300 component . key , 
301301 configurableProps , 
302302 configuredProps , 
303+  enabledOptionalProps , 
303304 ] ) ; 
304305
305306 // these validations are necessary because they might override PropInput for number case for instance 
@@ -388,6 +389,8 @@ export const FormContextProvider = <T extends ConfigurableProps>({
388389 updateConfiguredPropsQueryDisabledIdx ( configuredProps ) 
389390 } ,  [ 
390391 component . key , 
392+  configurableProps , 
393+  enabledOptionalProps , 
391394 ] ) ; 
392395
393396 // Update queryDisabledIdx reactively when configuredProps changes. 
@@ -397,6 +400,8 @@ export const FormContextProvider = <T extends ConfigurableProps>({
397400 updateConfiguredPropsQueryDisabledIdx ( configuredProps ) ; 
398401 } ,  [ 
399402 configuredProps , 
403+  configurableProps , 
404+  enabledOptionalProps , 
400405 ] ) ; 
401406
402407 useEffect ( ( )  =>  { 
@@ -442,6 +447,9 @@ export const FormContextProvider = <T extends ConfigurableProps>({
442447 // Preserve label-value format from remote options dropdowns 
443448 // Remote options store values as {__lv: {label: "...", value: ...}} 
444449 // For multi-select fields, this will be an array of __lv objects 
450+  // IMPORTANT: Integer props with remote options (like IDs) can be stored in __lv format 
451+  // to preserve the display label. We only delete the value if it's NOT in __lv format 
452+  // AND not a number, which indicates invalid/corrupted data. 
445453 const  isLabelValue  =  value  &&  typeof  value  ===  "object"  &&  "__lv"  in  value ; 
446454 const  isArrayOfLabelValues  =  Array . isArray ( value )  &&  value . length  >  0  && 
447455 value . every ( ( item )  =>  item  &&  typeof  item  ===  "object"  &&  "__lv"  in  item ) ; 
@@ -461,6 +469,8 @@ export const FormContextProvider = <T extends ConfigurableProps>({
461469 } 
462470 } ,  [ 
463471 configurableProps , 
472+  enabledOptionalProps , 
473+  configuredProps , 
464474 ] ) ; 
465475
466476 // clear all props on user change 
0 commit comments