hide suggestions on searchbox close

This commit is contained in:
Gerome Matilla 2020-06-09 12:21:57 +08:00
parent 3814cf563f
commit 2c3f2dfc3f
2 changed files with 4 additions and 3 deletions

View File

@ -7,9 +7,10 @@ class AutoSuggestion {
this._registerSearchBoxOnKeyUpEvent();
}
_hideSuggestions = () => {
hideSuggestions = () => {
// Hide suggestions
this._suggestionsContainer.classList.remove('suggestionsShow');
this._suggestionsUL.innerHTML = '';
}
_showSuggestions = () => {
@ -122,7 +123,7 @@ class AutoSuggestion {
if (this._searchBox.value < 1) {
// Hide suggestions
this._hideSuggestions();
this.hideSuggestions();
return;
}

View File

@ -38,7 +38,7 @@ class SearchBoxShow {
this._searchBox.value = '';
// Hide suggestions
console.warn('hideSuggestions()');
autoSuggestion.hideSuggestions();
this._searchBoxVisility = !this._searchBoxVisility;
}