diff --git a/hub/mixins.py b/hub/mixins.py index 5d7fb437b..aa3d5096a 100644 --- a/hub/mixins.py +++ b/hub/mixins.py @@ -24,6 +24,10 @@ class FilterMixin: def filters(self): filters = [] for param, value in self.request.GET.items(): + # we don't filter on blank values so skip them + if value == "": + continue + if "__" in param and param not in ["shader", "columns"]: name, comparator = param.split("__", 1) else: # pragma: nocover diff --git a/hub/static/js/explore.esm.js b/hub/static/js/explore.esm.js index c26af472c..aba8a6cdc 100644 --- a/hub/static/js/explore.esm.js +++ b/hub/static/js/explore.esm.js @@ -245,9 +245,16 @@ const app = createApp({ return url }, + filtersValid() { + return this.filters.every(function(filter){ + return filter.selectedValue !== ""; + }); + }, updateState() { - window.history.replaceState(this.state(), '', this.url()) - this.updateResults() + if (this.filtersValid()) { + window.history.replaceState(this.state(), '', this.url()) + this.updateResults() + } }, restoreState() { const params = new URL(window.location).searchParams diff --git a/hub/templates/hub/explore.html b/hub/templates/hub/explore.html index a5f35262c..31bcceece 100644 --- a/hub/templates/hub/explore.html +++ b/hub/templates/hub/explore.html @@ -47,11 +47,11 @@
Tip: Ctrl-click (PC) or Cmd-click (Mac) to select multiple items