Replies: 1 comment 5 replies
-
Hi @logartis, sections: (({ values }) => ({
title: "Prices",
dataType: "array",
of: {
title: "Conditional fields",
dataType: "map",
properties: {
available: {
dataType: "boolean",
title: "Available",
},
price: {
dataType: "number",
title: "Price",
validation: {
requiredMessage: "You must set a price between 0 and 1000",
min: 0,
max: 1000,
},
disabled: !values.available && {
clearOnDisabled: true,
disabledMessage:
"You can only set the price on available items",
},
description: "Price with range validation",
},
},
},
})), |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to use conditional fields in an array of maps but getting an error. Am I missing something or is it not supported? My use case would be to create an array of maps (Sections) with a SectionType enum that would determine the contents of that section.
Here is a minimal example with just a simple conditional field inside of an array of maps:
I am loving the library so far, great solution for an existing market gap!
Beta Was this translation helpful? Give feedback.
All reactions