Skip to content

Commit ad725c3

Browse files
committed
fix autocomplete demo
1 parent 20b36c2 commit ad725c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

demo/autocomplete.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,14 @@
181181
// the cache is a perfect addition
182182
// for an instant search on keypress
183183

184-
results = index.searchCache({
184+
results = userinput.value ? index.searchCache({
185185
query: userinput.value,
186186
suggest: suggest.checked,
187187
limit: 25,
188188
pluck: "title",
189189
enrich: true,
190190
highlight: "<b>$1</b>"
191-
});
191+
}) : [];
192192

193193
let entry, childs = suggestions.childNodes;
194194
let i = 0, len = results.length;

0 commit comments

Comments
 (0)