materialize icon indicating copy to clipboard operation
materialize copied to clipboard

How to select an option in the Autocomplete component?

Open softelos opened this issue 5 years ago • 2 comments

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?

softelos avatar Dec 23 '19 02:12 softelos

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?

morettic2015 avatar Jun 02 '20 01:06 morettic2015

:+1:

samijnih avatar Dec 14 '20 00:12 samijnih