Say I have my database like this-
[{label: ‘Player1’ , value:100},
{label:‘Player2’, value:200},
{label:‘Player3’, value:100}]
So when I am selecting Player3 from my dropdown, still Player1 is getting selected. I am feeding the dropdown though a wix query code
import wixData from ‘wix-data’ ;
export function populateDropdown () {
let allItems = ;
return wixData . query ( ‘playerInformation’ )
. ascending ( ‘players’ )
. find ()
. then (( results ) => {
let items = results . items ;
items . forEach (( item ) => {
let oneItem = {
label : item . players ,
value : item . score . toString ()
}
allItems . push ( oneItem );
})
return allItems ;
})
. catch ( err => console . log ( err ))
}