Set multiselect values dependant on other multiselect

Hey if I want to set a multiselect dropdowns values to be a subset if a user selects something from another multiselect, how would I do this?


Multiselect #1 has

['fruit', 'vegetables']

multiselect #2 has

['banana', 'cucumber']

if the user selects fruit, the second multiselect will auto populate to only have banana selected.

I tried

{{ multiselect#2. selectedItems = ['banana'] }}

but nothing happened

Hey there @BKM, you might want to use the filter function for that: {{ multiselect#2.selectedItems.filter(x=> x in [fruit_list]) }} or something of that logic. your example seems static and you didn't indicate if this will only be banana or multiple other fruits as potential values in multiselect2.