Skip to content

Commit 3632969

Browse files
committed
[fix] When blankSearch isn't set, don't flicker filtered results. Fixes #20.
1 parent cea1410 commit 3632969

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/autocomplete.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,9 @@ export default function autocomplete (el, options) {
496496
debouncedLoading(true);
497497
crossvent.fabricate(attachment, 'autocomplete-filter');
498498
const value = readInput();
499+
if (!o.blankSearch && !value) {
500+
hide(); return;
501+
}
499502
const nomatch = noMatches({ query: value });
500503
let count = walkCategories();
501504
if (count === 0 && nomatch && hasItems) {

src/taggy.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ module.exports = function taggy (el, options) {
207207
predictNextSearch,
208208
noMatches,
209209
noMatchesText: config.noMatches,
210+
blankSearch: config.blankSearch,
210211
debounce: config.debounce,
211212
set (s) {
212213
el.value = '';

0 commit comments

Comments
 (0)