Allow to reset app filters when clicking on the menu entry
This commit is contained in:
@@ -304,6 +304,15 @@ function onKeyDownHandler(event) {
|
||||
if (event.key === 'Escape') filter.value = '';
|
||||
}
|
||||
|
||||
function onAppsHashChange() {
|
||||
if (window.location.hash.split('?')[0] !== APPS_HASH_PATH) return;
|
||||
if (window.location.hash.indexOf('?') >= 0) return;
|
||||
filter.value = '';
|
||||
domainFilter.value = '';
|
||||
stateFilter.value = '';
|
||||
tagFilter.value = '';
|
||||
}
|
||||
|
||||
watch(filter, () => scheduleSyncFilterToUrl());
|
||||
watch(domainFilter, syncFiltersToUrl);
|
||||
watch(stateFilter, syncFiltersToUrl);
|
||||
@@ -340,12 +349,14 @@ onActivated(async () => {
|
||||
|
||||
window.addEventListener('resize', setItemWidth);
|
||||
window.addEventListener('keydown', onKeyDownHandler);
|
||||
window.addEventListener('hashchange', onAppsHashChange);
|
||||
|
||||
if (window.innerWidth > 575) setTimeout(() => searchInput.value.focus(), 0);
|
||||
});
|
||||
|
||||
onDeactivated(() => {
|
||||
window.removeEventListener('keydown', onKeyDownHandler);
|
||||
window.removeEventListener('hashchange', onAppsHashChange);
|
||||
clearInterval(refreshInterval);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user