Current datasource only accepts an array, for a large dataset, remote filtering may be more efficient.
Any plans to implement it?
@mb-copart Thanks for the input.
We're actually trying to move away from making these components opinionated. Remote filtering is definitely something we'd consider part of the application logic, not the UI presentation logic (the scope of this library).
Sorry about that! I suggest you look into something like redux for managing state such as this outside of your components :+1:
@mb-copart I'm not sure if you've gotten it worked out yet or not, but I'm in the middle of wiring the autocomplete to an API using redux. If you are interested, I can throw an example up and maybe get an edit to the docs to include it.
@smcguinness Im interested thanks
This is what Ive done:
<AutoComplete
dataSource={this.props.suggestions}
onUpdateInput={this.props.handleUpdateInput}
filter={(searchText: string, key: string) => true}
/>
The method handleUpdateInput
performs an AJAX requests and updates this.props.suggestions
. The key to make it work was to return true
in the filter
method. Otherwise it would behave bad.
Most helpful comment
This is what Ive done:
<AutoComplete dataSource={this.props.suggestions} onUpdateInput={this.props.handleUpdateInput} filter={(searchText: string, key: string) => true} />
The method
handleUpdateInput
performs an AJAX requests and updatesthis.props.suggestions
. The key to make it work was to returntrue
in thefilter
method. Otherwise it would behave bad.