From e673d965d534df4c67b7c527fb3fbe0b881437b2 Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 15 Apr 2021 21:45:34 +0200 Subject: [PATCH] Fix removing dates from a filter --- src/components/list/partials/filters.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/list/partials/filters.vue b/src/components/list/partials/filters.vue index 7328c9fa13..a58638ce21 100644 --- a/src/components/list/partials/filters.vue +++ b/src/components/list/partials/filters.vue @@ -310,6 +310,8 @@ export default { this.prepareRelatedObjectFilter('namespace') }, removePropertyFromFilter(propertyName) { + // Because of the way arrays work, we can only ever remove one element at once. + // To remove multiple filter elements of the same name this function has to be called multiple times. for (const i in this.params.filter_by) { if (this.params.filter_by[i] === propertyName) { this.params.filter_by.splice(i, 1) @@ -354,7 +356,12 @@ export default { this.params.filter_value.push(formatISO(new Date(parts[1]))) } this.change() + return } + + this.removePropertyFromFilter(filterName) + this.removePropertyFromFilter(filterName) + this.change() }, prepareDate(filterName, variableName) { if (typeof this.params.filter_by === 'undefined') {