Builder content link
Builder public api key
9b05a53a9463408aa0ffa696febd3688
What are you trying to accomplish
build a custom component
Screenshots or video link
n/a
Code stack you are integrating Builder with
- gatsby, react,
Reproducible code example
//Testing.builder.js
Builder.registerComponent(Testing, {
name: 'Testing',
inputs: [
{
name: 'LIST_INPUT',
type: 'list',
subFields: [
],
onChange: (options) => {
if (options.get('LIST_INPUT').length > 2) {
//
}
/*
if more than 2 items in LIST_INPUT
then change DROPDOWN_INPUT's dropdown content to ['A', 'B', 'C', 'D']
if less than 3 items in LIST_INPUT
then change DROPDOWN_INPUT's dropdown content to ['A', 'B']
*/
}
},
{
name: 'DROPDOWN_INPUT',
type: 'string',
enum: ['A', 'B']
},
]
})
Question: I was wondering if it’s possible to achieve the following:
Dynamically change the content of DROPDOWN_INPUT based on the number of items the user adds to LIST_INPUT.
Thank you so much for your help.