parent
c3a6e01040
commit
b6257400ec
|
@ -155,16 +155,7 @@ class SeriesSearchInput extends Component {
|
||||||
|
|
||||||
onSuggestionsFetchRequested = ({ value }) => {
|
onSuggestionsFetchRequested = ({ value }) => {
|
||||||
const fuse = new Fuse(this.props.series, fuseOptions);
|
const fuse = new Fuse(this.props.series, fuseOptions);
|
||||||
const suggestions = fuse.search(value).sort((a, b) => {
|
const suggestions = fuse.search(value);
|
||||||
if (a.item.sortTitle < b.item.sortTitle) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (a.item.sortTitle > b.item.sortTitle) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
this.setState({ suggestions });
|
this.setState({ suggestions });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue