thank you!
the thing is that this would work if I did not have objects within objects, I believe. When I select one size for one category, the item that shows up as selected is the category, but not the size.
The structure of my data is like this:
[
{category_1:
size:[S1,M1,L1]
},
{category_2:
size:[S2,M2,L2]
},
{category_3:
size:[S3,M3,L3]
}
]
Of course a deeper data structure requires some adjustements in the way you update the variables, but it’s the same principle. Try a test on a simpler structure, even if it’s not your use case, and once you grasp the logic you can adapt it to your specific case.