so i'm using a simple autocomplete method in polymer with
<paper-input autocomplete="on" name="stuff" list="stuffs"></paper-input>
with a simple list of items (tried both select and template elements to do this)
<datalist id="stuffs">
<option value="blah blah"/>
.
.
.
</datalist>
thing is, i wanna figure out a way to access the dynamic dropdown list of suggestions that appears during typing. is there actually a way for this?
I think your best bet then is to not use
datalist
.Here's an example of a component I wrote for my own use:
_valueChanged
observes changes tosearchValue
on input and toggles the collapse._listFilter
filters the items bound todom-repeat
based onsearchValue
.The
#resultList
or#collapse
element could be placed elsewhere for your own purposes.edit
I should point out that
choices
here is an Array of Objects each of which has a name attribute which is how they are filtered. It could easily be altered to filter on a Array of Strings depending on what you're trying to achieve.