From c097fbbdff3d2379b4ad468920ea4adde507b0fc Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 12 Sep 2017 11:19:17 -0400 Subject: [PATCH] FIX: Don't append `.no-results` if there's nothing to display --- .../discourse/widgets/search-menu-results.js.es6 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/widgets/search-menu-results.js.es6 b/app/assets/javascripts/discourse/widgets/search-menu-results.js.es6 index bc974d7c853..b4cd572c96c 100644 --- a/app/assets/javascripts/discourse/widgets/search-menu-results.js.es6 +++ b/app/assets/javascripts/discourse/widgets/search-menu-results.js.es6 @@ -130,15 +130,19 @@ createWidget('search-menu-results', { className: "filter filter-type"}))); } - return [ + let resultNode = [ h('ul', this.attach(rt.componentName, { searchContextEnabled: attrs.searchContextEnabled, searchLogId: attrs.results.grouped_search_result.search_log_id, results: rt.results, term: attrs.term })), - h('div.no-results', more) ]; + if (more.length) { + resultNode.push(h('div.no-results', more)); + } + + return resultNode; }); } });