Merge pull request #37736 from KerollesFathy/fix/date-picker-infinite-loop

fix: suppress change event during programmatic date set
This commit is contained in:
Ejaaz Khan 2026-04-17 12:00:21 +05:30 committed by GitHub
commit d6daefb3a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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