diff --git a/src/components/AutosuggestTextBox/AutosuggestTextBox.js b/src/components/AutosuggestTextBox/AutosuggestTextBox.js index b6216692d..ef2d84eea 100644 --- a/src/components/AutosuggestTextBox/AutosuggestTextBox.js +++ b/src/components/AutosuggestTextBox/AutosuggestTextBox.js @@ -143,11 +143,13 @@ export default class AutosuggestTextBox extends Component { const preferredResults = this.getPreferredResults() const reorderedSearchResults = searchResults.sort((a, b) => { - if(a.id === FILTER_SEARCH_ALL || a.name === this.props.inputValue) return -1 - if(b.id === FILTER_SEARCH_ALL || b.name === this.props.inputValue) return 1 + if (a.id === FILTER_SEARCH_ALL) return -1 + if (b.id === FILTER_SEARCH_ALL) return 1 + if (a.name === this.props.inputValue) return -1 + if (b.name === this.props.inputValue) return 1 return isChecked(b) - isChecked(a) }) - + if (!_isEmpty(preferredResults)) { let className = "mr-font-medium" items = items.concat(_map(reorderedSearchResults,