diff --git a/frappe/public/js/frappe/form/controls/date.js b/frappe/public/js/frappe/form/controls/date.js index 5a4f52154b..0c89407ea6 100644 --- a/frappe/public/js/frappe/form/controls/date.js +++ b/frappe/public/js/frappe/form/controls/date.js @@ -93,6 +93,7 @@ frappe.ui.form.ControlDate = class ControlDate extends frappe.ui.form.ControlDat // so explicitly bind the event this.datepicker.$datepicker.find('[data-action="today"]').click(() => { this.datepicker.selectDate(this.get_now_date()); + this.datepicker.hide(); }); } update_datepicker_position() { diff --git a/frappe/public/js/frappe/list/base_list.js b/frappe/public/js/frappe/list/base_list.js index c714fae97f..1ac582eca7 100644 --- a/frappe/public/js/frappe/list/base_list.js +++ b/frappe/public/js/frappe/list/base_list.js @@ -603,6 +603,11 @@ class FilterArea { this.$filter_list_wrapper = this.list_view.$filter_section; this.trigger_refresh = true; + + this.debounced_refresh_list_view = frappe.utils.debounce( + this.refresh_list_view.bind(this), + 300 + ); this.setup(); } @@ -764,13 +769,13 @@ class FilterArea { label: "ID", condition: "like", fieldname: "name", - onchange: () => this.refresh_list_view(), + onchange: () => this.debounced_refresh_list_view(), }); } if (this.list_view.custom_filter_configs) { this.list_view.custom_filter_configs.forEach((config) => { - config.onchange = () => this.refresh_list_view(); + config.onchange = () => this.debounced_refresh_list_view(); }); fields = fields.concat(this.list_view.custom_filter_configs); @@ -827,7 +832,7 @@ class FilterArea { options: options, fieldname: df.fieldname, condition: condition, - onchange: () => this.refresh_list_view(), + onchange: () => this.debounced_refresh_list_view(), ignore_link_validation: fieldtype === "Dynamic Link", is_filter: 1, }; @@ -889,7 +894,7 @@ class FilterArea { filter_button: this.filter_button, filter_x_button: this.filter_x_button, default_filters: [], - on_change: () => this.refresh_list_view(), + on_change: () => this.debounced_refresh_list_view(), }); } diff --git a/frappe/public/js/frappe/ui/filters/filter.js b/frappe/public/js/frappe/ui/filters/filter.js index 8d8c7a905b..6d3277733e 100644 --- a/frappe/public/js/frappe/ui/filters/filter.js +++ b/frappe/public/js/frappe/ui/filters/filter.js @@ -478,6 +478,7 @@ frappe.ui.filter_utils = { df.description = ""; df.reqd = 0; + df.length = 1000; // this won't be saved, no need to apply 140 character limit here df.ignore_link_validation = true; // given diff --git a/frappe/public/js/frappe/ui/filters/filter_list.js b/frappe/public/js/frappe/ui/filters/filter_list.js index 69712caf3f..f3af6415c5 100644 --- a/frappe/public/js/frappe/ui/filters/filter_list.js +++ b/frappe/public/js/frappe/ui/filters/filter_list.js @@ -64,10 +64,7 @@ frappe.ui.FilterGroup = class { set_popover_events() { $(document.body).on("click", (e) => { if (this.wrapper && this.wrapper.is(":visible")) { - const in_datepicker = - $(e.target).is(".datepicker--cell") || - $(e.target).closest(".datepicker--nav-title").length !== 0 || - $(e.target).parents(".datepicker--nav-action").length !== 0; + const in_datepicker = $(e.target).parents(".datepicker").length; if ( $(e.target).parents(".filter-popover").length === 0 &&