[frontend] Only suggest facet values and no results when autocompleting facets in the top search
@@ -1023,18 +1023,16 @@ from desktop.views import _ko
}
}
+
+ if (!facetMatch && typeof data.results !== 'undefined' && data.results.length > 0) {
if (values.length > 0) {
values.push({ divider: true });
}
- if (typeof data.results !== 'undefined') {
data.results.forEach(function (result) {
values.push({ data: { label: result.hue_name, icon: SEARCH_TYPE_ICONS[result.type], description: result.hue_description }, value: beforePartial + result.originalName });
});
}
- if (values.length > 0 && values[values.length - 1].divider) {
- values.pop();
- }
if (values.length === 0) {
values.push({ noMatch: true });
}
