Explore: make query field suggestions more robust

- drop invalid history items
- make highlighter more robust by defaulting to empty string on text to highlight
This commit is contained in:
David Kaltschmidt
2018-11-23 12:15:26 +01:00
parent 91d97ab5b5
commit f831836fa7
3 changed files with 7 additions and 5 deletions

View File

@@ -42,7 +42,7 @@ class TypeaheadItem extends React.PureComponent<TypeaheadItemProps> {
render() {
const { isSelected, item, prefix } = this.props;
const className = isSelected ? 'typeahead-item typeahead-item__selected' : 'typeahead-item';
const { label } = item;
const label = item.label || '';
return (
<li ref={this.getRef} className={className} onClick={this.onClick}>
<Highlighter textToHighlight={label} searchWords={[prefix]} highlightClassName="typeahead-match" />