Commit 98a95633 authored by Clement Ho's avatar Clement Ho

Reset filters when clear search is clicked

parent 88ed0159
...@@ -121,6 +121,15 @@ ...@@ -121,6 +121,15 @@
hideDropdown() { hideDropdown() {
this.getCurrentHook().list.hide(); this.getCurrentHook().list.hide();
} }
resetFilters() {
const hook = this.getCurrentHook();
const data = hook.list.data;
const results = data.map(function(o) {
o.droplab_hidden = false;
});
hook.list.render(results);
}
} }
global.FilteredSearchDropdown = FilteredSearchDropdown; global.FilteredSearchDropdown = FilteredSearchDropdown;
......
...@@ -247,6 +247,9 @@ ...@@ -247,6 +247,9 @@
this.filteredSearchInput.value = ''; this.filteredSearchInput.value = '';
this.clearSearchButton.classList.add('hidden'); this.clearSearchButton.classList.add('hidden');
// Reset Filters
this.mapping[this.currentDropdown].reference.resetFilters();
// Force dropdown to hide // Force dropdown to hide
this.mapping[this.currentDropdown].reference.hideDropdown(); this.mapping[this.currentDropdown].reference.hideDropdown();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment