From edca0911082e947f83166955bab940c485d2eb14 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Tue, 9 Jun 2020 22:57:20 +0200 Subject: [PATCH] Hide completion window earlier --- editor/src/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/editor/src/index.js b/editor/src/index.js index 9fe9bd0..f285da3 100644 --- a/editor/src/index.js +++ b/editor/src/index.js @@ -77,11 +77,16 @@ function showSearchResults(searchTool, query, input, value, resultType) { } function showSearchResultsExtended(element, template, searchTool, query, input, value, resultType, options) { + const $lc = $(element) let results = searchTool(query) + if (query.length === 0 || !results.length) { + $lc.fadeOut() + return + } + let opt = options || {}; - const $lc = $(element) $lc.data('result-type', resultType) if (opt.belowCursor) {