appnexus / lucid

A UI component library from Xandr.
https://appnexus.github.io/lucid
Other
201 stars 80 forks source link

Autocomplete better support for async suggestions #279

Open ogupte opened 8 years ago

ogupte commented 8 years ago

The Autocomplete component was optimized for known suggestions but it needs to have better support (like loading indicators) for suggestion which are backed by an async API

ghost commented 8 years ago

Here are a couple of issues/potential QoL improvements I've noticed when implementing lucid's autocomplete with async suggestions.

let mySuggestionsFromApi = [{id: 1, name: 'foo'}, {id:2, name: 'bar'}];
//...
suggestions={mySuggestionsFromApi}
suggestionFormatter={(suggestion) => {suggestion.name}}
onSelect={(index) => {
  goStoreTheIdOfMySelection(mySuggestionsFromApi[index].id);
}}
strunkandwhite commented 8 years ago

On hold until UX can resolve patterns around filtering/selecting/searching