Collaborne / paper-search

A Material Design search bar (Polymer)
https://www.webcomponents.org/element/Collaborne/paper-search
Apache License 2.0
51 stars 29 forks source link

No way to add search suggestions/autofill #3

Open emanguy opened 8 years ago

emanguy commented 8 years ago

I'm not sure if this is currently on the element roadmap, but it would be incredibly useful if you could add an array of some element to the search bar for autofill and suggestions while the user is typing. If this is already implemented I'm missing it in the documentation.

The functionality I'm looking for is similar to that of the search dialog in Google Play Music: image The elements in the node list would most likely be something similar to the paper-bottom-sheet-item you implemented over in paper-bottom-sheet. Clickable options with an iron-icon.

EDIT: For binding purposes, it would probably be easier to just provide an array of objects in the following format:

[
    {
        "icon": "search",
        "boldtext": "this is m",
        "trailingtext": "y input string"
    },
    {
        "icon": "history",
        "boldtext": "you previously ",
        "trailingtext": "searched for this"
    }
]
ronnyroeller commented 8 years ago

@emanguy We currently have no plans of adding this functionality. But I do agree that it's a good idea. Feel free to provide a PR.

ankitkante commented 7 years ago

@emanguy You can use paper-listbox to emulate the behaviour of a search and suggest.On query-changed event, you can fetch your search results and populate the paper-item tags.