From c1e20c84b4c8a201d7d10224eef48e320787916a Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Tue, 14 Mar 2023 16:47:57 +0100 Subject: [PATCH] fix: clear all filters when in list view --- frappe/public/js/frappe/ui/filters/filter_list.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/ui/filters/filter_list.js b/frappe/public/js/frappe/ui/filters/filter_list.js index 3119ee4b68..69d089ef3a 100644 --- a/frappe/public/js/frappe/ui/filters/filter_list.js +++ b/frappe/public/js/frappe/ui/filters/filter_list.js @@ -128,7 +128,14 @@ frappe.ui.FilterGroup = class { this.wrapper.find(".clear-filters").on("click", () => { this.toggle_empty_filters(true); - this.clear_filters(); + if (typeof this.base_list !== "undefined") { + // It's a list view. Clear all the filters, also the ones in the + // FilterArea outside this FilterGroup + this.base_list.filter_area.clear(); + } else { + // Not a list view, just clear the filters in this FilterGroup + this.clear_filters(); + } this.on_change(); });