Hi! What am I missing here?
Here is some code in a dropdown component at onActionPerformed event:
itemValido = False
for item in self.props.options:
if item.value == self.props.value:
itemValido = True
break
I’m using this to check if the user is creating a new item (The option allowCustomOptions is true in the dropdown)
When I use integer values in the dropdown.props.options, its works fine. like this:
[
{
"label": "Excel",
"value": 1
},
{
"label": "Pacote Office",
"value": 2
}
]
But when I use object values, it’s doesn’t work:
[
{
"label": "Excel - Básico",
"value": {
"value": 1,
"nivel": 1
}
},
{
"label": "Excel - Intermeadiário",
"value": {
"value": 1,
"nivel": 2
}
}
]
The variable itemValido never becomes true