The attached image is an LWC, in which Category is a controlling picklist (Combobox) and Sub Categ is the Dependent Picklist.
Eg. Category 1: Sub Categ 1,2,3 Category 2: Sub Categ 2,3
I am storing Selected Sub Category values in an array and I want to use it further. The array variable is set with selected values in the onChange method of dual-listbox.
Here the problem is initially if I select Category=1 and Select Sub Category = 1,2,3. But then I remember oh I wanted to select Category = 2
Here what happens is when I change the Category, Sub Category selected values automatically changed to 2,3. But I am not able to set those values to an array variable. The array will still hold previous values 1,2,3