You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let me see if I can explain this.... When building schemas dynamically, specifically enum lists, the formData sometimes gets in a state where you have loaded new enums for that select but the stored value you have is no longer a valid enum. It would be nice if there was an option to automatically omit/reset that data to a default (which may have also changed based on the dynamic building of options).
So on change, if my value for an enum is not one of the allowed enums, set it to ...
(in this order)
A. a default if provided
B. The first valid enum
C. if A or B aren't applicable, an empty value
I have tried many things to get around this issue to no avail. Maybe this should be included in omitExtraData? Or a new option all together?
UPDATE: kinda got it working by adding the following useEffect to my SelectWidget. There must be other useEffects running elsewhere as I can't get it to work right without the setTimeout (gross, I know).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Let me see if I can explain this.... When building schemas dynamically, specifically enum lists, the formData sometimes gets in a state where you have loaded new enums for that select but the stored value you have is no longer a valid enum. It would be nice if there was an option to automatically omit/reset that data to a default (which may have also changed based on the dynamic building of options).
So on change, if my value for an enum is not one of the allowed enums, set it to ...
(in this order)
A. a default if provided
B. The first valid enum
C. if A or B aren't applicable, an empty value
I have tried many things to get around this issue to no avail. Maybe this should be included in
omitExtraData
? Or a new option all together?UPDATE: kinda got it working by adding the following useEffect to my
SelectWidget
. There must be other useEffects running elsewhere as I can't get it to work right without thesetTimeout
(gross, I know).Beta Was this translation helpful? Give feedback.
All reactions