diff --git a/dashboard/src/views/AppsView.vue b/dashboard/src/views/AppsView.vue index b503caaa8..bf3734646 100644 --- a/dashboard/src/views/AppsView.vue +++ b/dashboard/src/views/AppsView.vue @@ -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); });