Merge pull request #38548 from KerollesFathy/fix-int-float-dirty-on-input

fix(ui): mark form "Not Saved" on input for Int and Float fields
This commit is contained in:
Kerolles Fathy 2026-04-14 19:18:04 +02:00 committed by GitHub
parent fa53a971c2
commit 4944dec916
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View file

@ -185,6 +185,12 @@ frappe.ui.form.ControlData = class ControlData extends frappe.ui.form.ControlInp
// debounce to avoid repeated validations on value change
this.$input.on("input", frappe.utils.debounce(change_handler, 500));
}
if (this.constructor?.trigger_dirty_on_input_event) {
this.$input.on("input", () => {
this.frm?.dirty();
});
}
}
setup_autoname_check() {
if (!this.df.parent) return;

View file

@ -1,5 +1,6 @@
frappe.ui.form.ControlInt = class ControlInt extends frappe.ui.form.ControlData {
static trigger_change_on_input_event = false;
static trigger_dirty_on_input_event = true; // mark dirty without reformatting
static input_mode = "numeric";
make() {
super.make();