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

Reset filters when clear search is clicked

parent 88ed0159
......@@ -121,6 +121,15 @@
hideDropdown() {
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;
......
......@@ -247,6 +247,9 @@
this.filteredSearchInput.value = '';
this.clearSearchButton.classList.add('hidden');
// Reset Filters
this.mapping[this.currentDropdown].reference.resetFilters();
// Force dropdown to hide
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