materialize
materialize copied to clipboard
How to select an option in the Autocomplete component?
It doesn't seem to be a way to make the Autocomplete component to select one of the existing options by index. How can I do this?
Also facing same problem. Need to set a selected option after component is initiated but dont know how to achieve this.
Tried:
`
let acl = document.getElementById("task_lead");
let leads = M.Autocomplete.getInstance(acl);
leads.activeIndex = 1;
leads.dropdown.$el[0].M_Dropdown.$el[0].value = 1;
` But it does not works. How to set a selected value similar to a select / options html?
:+1: