From 37a8a82af3f1e4b512fb1c5f725dc659e46626e4 Mon Sep 17 00:00:00 2001 From: Richard Bondi Date: Fri, 20 May 2016 13:33:09 -0500 Subject: [PATCH] hide menu when zero filtered items, this prevents erroneous errors when enter or tab is hit after typing the trigger then typing to empty the list. (#3) --- js/tribute.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/tribute.js b/js/tribute.js index d7c6ad8a..00f36612 100644 --- a/js/tribute.js +++ b/js/tribute.js @@ -178,6 +178,11 @@ if (!Array.prototype.find) { this.current.filteredItems = items + if(!items.length) { + this.hideMenu(); + return; + } + let ul = this.menu.querySelector('ul') ul.innerHTML = ''