From: Alexander Moisseev Date: Sat, 25 Jan 2025 15:06:29 +0000 (+0300) Subject: [WebUI] Reset dropdown when clearing filters X-Git-Tag: 3.11.1~23^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F5317%2Fhead;p=thirdparty%2Frspamd.git [WebUI] Reset dropdown when clearing filters Ensure the action dropdown resets to its default value when clearing filters in the history table. --- diff --git a/interface/js/app/libft.js b/interface/js/app/libft.js index 7106516a2b..ca2a1ebef2 100644 --- a/interface/js/app/libft.js +++ b/interface/js/app/libft.js @@ -318,6 +318,13 @@ define(["jquery", "app/common", "footable"], self.removeFilter("action"); } self.filter(); + }, + draw: function () { + // Ensure the dropdown reflects the default value when filters are cleared. + this._super(); + const actionFilter = this.find("action"); + const isActionFilterApplied = actionFilter instanceof FooTable.Filter; + if (this.$action && !isActionFilterApplied) this.$action.val(this.def); } }); /* eslint-enable consistent-this, no-underscore-dangle */