I have created 2 dynamic input fields, both populated from an API.
Field 2 (channelId
) is dependent on the choice in field 1 (appId
).
inputFields: s
{
key: 'appId',
label: 'App',
required: true,
type: 'text',
helpText: 'Choose the App',
dynamic: 'app.id.display_name',
altersDynamicFields:true,
},
{
key: 'channelId',
label: 'Channel',
required: true,
type: 'string',
helpText: 'Choose the Channel',
dynamic: 'channel.channel',
}
]
This works fine the first time the user makes choices.
However, if they choose both options, and then change field 1 (appId
) it does not clear the selection in Field 2 (channelId
)
If you re open the menu, you see the new choices - so the perform
is running in the resource, but the previous selected value is not cleared- leaving an invalid selection.
How do you ensure that the dependent field is cleared when the field that alters it is changed?