Fix clear button so that it resets the dropdowns properly

This commit is contained in:
Clement Ho 2016-12-09 15:47:56 -06:00
parent e5b061b801
commit 88ed015915
2 changed files with 12 additions and 0 deletions

View File

@ -117,6 +117,10 @@
item.droplab_hidden = !match && !matchWithoutPrefix; item.droplab_hidden = !match && !matchWithoutPrefix;
return item; return item;
} }
hideDropdown() {
this.getCurrentHook().list.hide();
}
} }
global.FilteredSearchDropdown = FilteredSearchDropdown; global.FilteredSearchDropdown = FilteredSearchDropdown;

View File

@ -246,7 +246,15 @@
this.filteredSearchInput.value = ''; this.filteredSearchInput.value = '';
this.clearSearchButton.classList.add('hidden'); this.clearSearchButton.classList.add('hidden');
// Force dropdown to hide
this.mapping[this.currentDropdown].reference.hideDropdown();
// Re-Load dropdown
this.setDropdown(); this.setDropdown();
// Reposition dropdown so that it is aligned with cursor
this.updateDropdownOffset(this.currentDropdown);
} }
checkForBackspace(e) { checkForBackspace(e) {