From e54f003455c8db6e9d6aa7dff0a66daa024352cb Mon Sep 17 00:00:00 2001 From: efpont Date: Thu, 26 Apr 2018 13:37:28 +0200 Subject: [PATCH] _createSuggestions empty value fix --- paper-autocomplete-suggestions.html | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/paper-autocomplete-suggestions.html b/paper-autocomplete-suggestions.html index 2207901..e3868e3 100644 --- a/paper-autocomplete-suggestions.html +++ b/paper-autocomplete-suggestions.html @@ -538,12 +538,14 @@ if (value != null && value.length >= this.minLength) { value = value.toLowerCase(); - - // Search for the word in the source properties. - if (this.source && this.source.length > 0) { - // Call queryFn. User can override queryFn() to provide custom search functionality - this._suggestions = this.queryFn(this.source, value); - } + } else { + value = ''; + } + + // Search for the word in the source properties. + if (this.source && this.source.length > 0) { + // Call queryFn. User can override queryFn() to provide custom search functionality + this._suggestions = this.queryFn(this.source, value); } else { this._suggestions = []; }