fix: suppress change event during programmatic date set

Fixes: #37715
This commit is contained in:
KerollesFathy 2026-03-03 12:18:58 +00:00
parent 70a8693b1b
commit 6bcaffa043

View file

@ -39,7 +39,9 @@ frappe.ui.form.ControlDate = class ControlDate extends frappe.ui.form.ControlDat
}
if (should_refresh) {
this._suppress_change = true;
this.datepicker.selectDate(frappe.datetime.str_to_obj(value));
this._suppress_change = false;
}
}
set_date_options() {
@ -68,7 +70,9 @@ frappe.ui.form.ControlDate = class ControlDate extends frappe.ui.form.ControlDat
maxDate: this.df.max_date,
firstDay: frappe.datetime.get_first_day_of_the_week_index(),
onSelect: () => {
this.$input.trigger("change");
if (!this._suppress_change) {
this.$input.trigger("change");
}
},
onShow: () => {
this.datepicker.$datepicker