Allow to reset app filters when clicking on the menu entry

This commit is contained in:
Johannes Zellner
2026-02-26 11:05:08 +01:00
parent 18ef97fae6
commit b6b0969879

View File

@@ -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);
});