Skip to content

Commit

Permalink
Merge pull request #1177 from alisman/searchExample
Browse files Browse the repository at this point in the history
Prevent alphabetical sorting of items in example search list of query…
  • Loading branch information
alisman authored May 17, 2018
2 parents 8337985 + 326ecfb commit cd52420
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/shared/components/query/CancerStudySelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ export default class CancerStudySelector extends QueryStoreComponent<ICancerStud
searchTextOptions = [this.store.searchText].concat(searchTextOptions as string[]);
let searchTimeout: number | null = null;

const optionsWithSortKeys = searchTextOptions.map((name,i)=>{
return { value: name, sortKey: i }
});

return (
<div style={{display: 'flex', alignItems: 'center'}}>
{
Expand All @@ -253,7 +257,7 @@ export default class CancerStudySelector extends QueryStoreComponent<ICancerStud
)
}
<Autosuggest
datalist={searchTextOptions}
datalist={optionsWithSortKeys}
ref={(el: React.Component<any, any>) => this.autosuggest = el}
placeholder="Search..."
bsSize="small"
Expand Down

0 comments on commit cd52420

Please sign in to comment.