Skip to content

Commit 1a1d08f

Browse files
author
Rob Peters
committed
Add showSuggestions function
1 parent 6b0b468 commit 1a1d08f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

paper-autocomplete-suggestions.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,11 @@
894894
}.bind(this), 0);
895895
},
896896

897+
showSuggestions: function (query) {
898+
query = query || '';
899+
this._suggestions = this.queryFn(this.source, query.toLowerCase());
900+
},
901+
897902
/**
898903
* Query function is called on each keystroke to query the data source and returns the suggestions that matches
899904
* with the filtering logic included.

paper-autocomplete.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,13 @@
697697
this.$.paperAutocompleteSuggestions.hideSuggestions();
698698
},
699699

700+
showSuggestions: function (query) {
701+
if (query && this.$.autocompleteInput.value != query) {
702+
this.$.autocompleteInput.value = query;
703+
}
704+
this.$.paperAutocompleteSuggestions.showSuggestions(query);
705+
},
706+
700707
/**
701708
* Allows calling the onSelect function from outside
702709
* This in time triggers the autocomplete-selected event

0 commit comments

Comments
 (0)