Merge pull request #25413 from ankush/fix_time_ctl
fix: wait for datepicker changes to propogate
This commit is contained in:
commit
3d8e8463a8
4 changed files with 12 additions and 8 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 &&
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue