Choices
Choices copied to clipboard
The search field is not shown.
I have the Choices in React, no error the choices are loaded with axios correctly, but the search field is not loaded even if I force loading with the options.
I paste my code.
useEffect(()=>{
axios.get("/api/maps?page=1&search="+"gel",{
headers:{
"Content-Type": "application/json",
accept: "application/json"
}
}).then(response => {
new Choices(document.getElementById("choices"),{
choices:response.data,
searchChoices: true,
removeItemButton: true,
searchFields: ["label", "value"],
loadingText: "Loading...",
placeholder: true,
})
})
},[])
return(
<>
<select
multiple={false}
className="form-control"
id="choices"
/>
</>
)
Thank you.
@ochov1 , were you able to solve this?
@EINazare no, this is still not working.