Closed michael-learns closed 7 years ago
I think you got very close, and it seems your use case closely resembles the custom template demo, so you could look there for answers:
3 things to consider:
<dom-repeat>
needs to be wrapped into a <template>
.
The element needs a template
if you want to use a custom dropdownitems
is filtered and exposed as items
, not members
.<dom-repeat>
's content itself also needs to be wrapped in a <template>
.
This is an API change since Polymer 2.x.With these 3 changes, and provided members
resembles something like [{name: "something"}, {name: "something else"}]
, you should be good to go with this code:
<paper-dropdown-input label="Members" items="[[members]]" filter-property="name">
<template>
<dom-repeat items="[[items]]" as="member">
<template>
<paper-item>{{member.name}}</paper-item>
</template>
</dom-repeat>
</template>
</paper-dropdown-input>
Please let me know if you have any luck with this.
@Juravenator Yes! That works perfectly. Btw, is there anyway I can get the selected value and pass it to a function when I on-tap
a button?
Hi. I've been looking for something like this and right now I'm facing this problem.
I have this as a code:
`
`
And when I click the dropdown it immediately shows 'No Results Found' and no items are shown. Only when I type something on the input do the items appear. But even then the items are shown as
[object Object]
. How do I fix this?