This code was working yesterday but for some reason today it is not and I am not sure why.
let OptionsHolder = [
{"label": "One", "value": "A"},
{"label": "Two", "value": "B"},
{"label": "Three", "value": "C"}
]
$w("dropdown3").options = OptionsHolder
The code above works and the dropdown box holds the options, however whenever I try to set a value it removes all the options from the dropdown so the dropdown section is just a little black bar.
let OptionsHolder = [
{"label": "One", "value": "A"},
{"label": "Two", "value": "B"},
{"label": "Three", "value": "C"}
]
$w("#dropdown3").options = OptionsHolder
// Works
let SelectedValue = "A"
$w("#dropdown3").value = SelectedValue
I have run tests, the value the Dropdown box is set to is the same as the value in the OptionsHolder.
Tests:
if (OptionsHolder[0].value === SelectedValue) {
console.log("True") // This is returned
}
console.log($w("#dropdown3").options) // Returns OptionsHolder
console.log($w("#dropdown3").value) // Returns "A"
Does anyone know what it is not working?
The blank dropdown after the value was set: